New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing diff viewer options results in an exception #833

Closed
living180 opened this Issue May 27, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@living180
Contributor

living180 commented May 27, 2018

Changing a diff viewer option, for example, toggling Ignore all whitespace results in the following exception:

Traceback (most recent call last):
  File "/home/dharding/code/git-cola/cola/qtutils.py", line 39, in <lambda>
    action.triggered[bool].connect(lambda x: fn())
  File "/home/dharding/code/git-cola/cola/widgets/diff.py", line 597, in update_options
    self.widget.update_options()
AttributeError: 'Viewer' object has no attribute 'update_options'

living180 added a commit to living180/git-cola that referenced this issue May 27, 2018

diff: fix changing diff viewer options
In commit 649de5b the diff viewer was
refactored to be able to display images diffs.  As a result of that
change the "parent" passed to the Options object is now a Viewer rather
than a DiffEditor.  In the Options.update_options() method, it calls the
update_options() method of the "parent" provided when it was
constructed.  However, unlike DiffEditor, Viewer did not have an
update_options() method, which would cause an exception when
Options.update_options() was executed.

To address this add an update_options() method to Viewer which delegates
to the update_options() method of the contained DiffEditor.

Fixes: #833

Signed-off-by: Daniel Harding <dharding@living180.net>

davvid added a commit to davvid/git-cola that referenced this issue May 28, 2018

Revert "diff: set the callback widget to the diff editor"
This reverts commit 68399e3.

Related-to: #833
Related-to: #834
Signed-off-by: David Aguilar <davvid@gmail.com>

davvid added a commit to davvid/git-cola that referenced this issue May 28, 2018

Merge pull request #834 from living180/fix_diff_options
* living180/fix_diff_options:
  diff: fix changing diff viewer options

Closes #833
Signed-off-by: David Aguilar <davvid@gmail.com>

@davvid davvid closed this in #834 May 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment