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

living180
Copy link
Contributor

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

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
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
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
* 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
@davvid
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 fix_diff_options branch May 28, 2018 11:09
@living180
Copy link
Contributor Author

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants