-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix focus when undoing #382
Conversation
6d1a5ed
to
4f3499d
Compare
I'd suggest reviewing this PR in its current state. I think it completely addresses one issue (focus when undoing/redoing), the position of the caret is unrelated, even though they concur in #371. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, except for possibly removing the if
-statement when undoing/redoing. Otherwise just some minor requests for clarification :)
if editDoc == self.arabic_area.getStyledDocument(): | ||
self.arabic_area.requestFocusInWindow() | ||
elif editDoc == self.edit_area.getStyledDocument(): | ||
self.edit_area.requestFocusInWindow() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're using the secondary area and we undo, this will change the focus to the primary area. That's not ideal, but not sure how easy to fix (if the two areas share a styled document, I guess we can't distinguish that way).
If we end up having to look at more than the two areas we are checking at the moment, it may be better to check in a loop. This is probably better placed in a new PR, though - I'll open an issue about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened issue #402 for this.
@giordano Can you rebase on |
Co-Authored-By: ageorgou <[email protected]>
This is my initial attempt at fixing #371. There are two separate issues here:
Currently this PR fixes the first issue, I marked it as draft because it's not yet complete, as I have to:
AtfAreaController.undo()
, maybe it can be simplified