Skip to content
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
Closed

Changing diff viewer options results in an exception #833

living180 opened this issue May 27, 2018 · 0 comments

Comments

@living180
Copy link
Contributor

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
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: git-cola#833

Signed-off-by: Daniel Harding <dharding@living180.net>
davvid added a commit to davvid/git-cola that referenced this issue May 28, 2018
This reverts commit 68399e3.

Related-to: git-cola#833
Related-to: git-cola#834
Signed-off-by: David Aguilar <davvid@gmail.com>
davvid added a commit to davvid/git-cola that referenced this issue May 28, 2018
* living180/fix_diff_options:
  diff: fix changing diff viewer options

Closes git-cola#833
Signed-off-by: David Aguilar <davvid@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant