-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Use dialog for external changes #1309
Conversation
# Conflicts: # src/Services/Document.vala
# Conflicts: # src/Services/Document.vala
# Conflicts: # src/Services/Document.vala
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.
Code looks good. Gonna give a test over the next day or two for you.
Fix typo Co-authored-by: Ryan Kornheisl <[email protected]>
Trying to test by editing the same file in nano is causing two things:
|
@zeebok Thanks very much for testing this out. Autoloading of external changes is mention in the comments above and is motivated by the need to change git branches without triggering the dialog unnecessarily. The changes should only autoload if there are no unsaved changes to the document.
There is an open question as to whether there needs to be a toast or something indicating the changes have been loaded. Since the changes were presumably made by the same user not sure this is needed. Undoing shouldn't clear the document though - I'll look into that. You should get the dialog if there are conflicting changes made internally and externally which in effect means "autosave" is off. I used |
Regarding the |
I have achieved single-click undo of autoload by using copy/paste rather than just setting the buffer text. This is at the cost of more code and dealing with the asynchronous nature of pasting. Its not quite perfect because after undo the old text remains selected but selection is not recorded by the undo manager so cannot be undone. Questionable whether this is worth the extra complexity as this would be likely to be used very rarely in practice. |
Would a better path be to clear the undo history so trying to undo doesn't do anything? |
Okay now that I know that I can confirm the detection and dialog work as describe! I would say once we settle on what to do about undo, this is good to merge. |
It would be simpler to disable undoing changes made by autoloading external changes, if that is acceptable. |
I think it is but I am just a single user |
@zeebok I agree with you. Most users would probably rarely, if ever, trigger this code anyway. |
Fixes #965
Fixes #1327
Following #1308, use dialog instead of infobar when there are external changes
The next Code release is waiting for this to be merged.