The main keypress handler on_key_press_event() checks for external
file changes of the current open tab. If it finds one it asks the user if
he wants to reload the document.
After returning from that check and after possibly reloading
the file the key is processed normally, If the key is interacting
with the editor e.g. a "normal" character key that inserts a
character in the document, the key press changes the document
that was just reloaded which is most probably unwanted.
But when pondering the whole issue and possible solutions
i came to the conclusion that checking for changed files
in the key handler is wrong altogether. The current method
does not only change newly reloaded documents it does also
reload files when the key press has nothing to do with the editor
itself at all. Because key presses happen so often the code even
tries to mitigate the performance problem by checking only
after a configurable timeout.
Using keypresses as a poor man's scheduler is just wrong.
We should add a scheme that monitors open files with
libnotify for example to get notifications instantly.
I am not familiar enough with geany to add it myself
though. Multiplatform considerations apply too.
Log in to post a comment.