-
-
Notifications
You must be signed in to change notification settings - Fork 113
Improve handling of external changes #1288
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
Conversation
zeebok
left a comment
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. I will give this a good test tomorrow!
# Conflicts: # src/Services/Document.vala
|
Phew tomorrow took a bit to arrive but I did start testing! I did notice some things:
|
|
@danirabbit In view of your comments on #1307, is this something that would also be better done with a dialog? The infobar now contains a lot of information in this PR. |
This is expected - Code does not continually monitor the file on disk, it only checks the file status when an edit is made and autosave is ON, or when a save is attempted. However, I confirm that the behaviour after a save attempt is made is unsatisfactory - no reason for the save failure is given. This in fact was the motivation for #1307 as it was happening under other circumstances. The whole system for saving files in Code is quite tricky to work on. |
|
Converting to draft pending decision regards dialog and whether to incorporate in #1308 (or at least develop together) |
But it does appear to do it with a file I load. I load a file in Code, edit it externally, and I get the message when I go back to Code. |
Hmm, OK. Not sure why that should be but there are a lot of moving parts involved. I'll make sure to include the two possibilities in my testing. Hopefully #1309 handles this better. |
|
@zeebok It seems your issue is caused by the "focus-in" handler not being connected for new documents after they are saved - fixing. |
|
Closing in favor of #1309 |
Fixes #17
In master, if AUTOSAVE is on and external changes are made to an open document these changes are immediately imported into that document as soon as it is focused whereas if AUTOSAVE is off then an infobar is shown. It is unclear why there should be this difference in behaviour so this PR always gives the user a choice of reloading the document or overwriting the external changes.
Note that the current infobar is limited to two options with a horizontal layout so is not ideal for fitting into half-tiled window. As a conflict with an external edit could be considered a corner case no attempt was made to use a different widget here. The third "Save As" option already exists in the headerbar anyway.
The infobar might be considered too verbose in which case alternative text suggestions welcome.