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

diff: fix changing diff viewer options #834

Merged
merged 1 commit into from May 28, 2018

Conversation

Projects
None yet
2 participants
@living180
Copy link
Contributor

living180 commented 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: #833

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

This comment has been minimized.

Copy link
Member

davvid commented May 27, 2018

I think I may have papered over this in 68399e3 by setting the options.widget to the text widget, but I like your solution much better. Can you throw a revert of 68399e3 into your branch and verify that it's working correctly?

I'll merge this later tonight once I'm back home. Thanks!

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

Revert "diff: set the callback widget to the diff editor"
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 pull request May 28, 2018

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

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

@davvid davvid merged commit ec5b0f5 into git-cola:master May 28, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@davvid

This comment has been minimized.

Copy link
Member

davvid commented May 28, 2018

Just tested this out -- yup, reverting my commit was the right thing to do. Thanks!

@living180 living180 deleted the living180:fix_diff_options branch May 28, 2018

@living180

This comment has been minimized.

Copy link
Contributor Author

living180 commented May 28, 2018

Thanks for the merge! I hit the issue while running 3.1, and tried to test master but didn't realize it was a couple of weeks behind so I never saw your change from 68399e3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.