If a file changes on disk, kate normally shows a warning dialog and offers to load the changes from disk or to overwrite the file on disk with the current editor contents. After a recent update, it stopped doing this, and reloads the file without confirmation. I'm not sure when exactly this changed. If this is a feature instead of a bug, I'd like to have a way to enable the old behavior. The "warn about files modified by foreign process" checkbox in the settings is checked. This is about the case when there are no unsaved changes in the editor.
PS: as a barely related bug, I've observed that kate _failed_ to reload changes from disk (after showing the confirmation dialog and instructing it to reload). This is probably an unrelated bug. Reproduction is hard and sporadic. Manually reloading works. Is this known/fixed yet?
How do the files on disk change? Do you use git pull, and then the files change? Or is it not version controlled? I am asking, since for git controlled files, we do not show a reload message anymore, since the reload is wanted in 99% of the time (i.e. many users like this).
Yes, this is in git repos. I definitely want the old behavior. There are a lot of cases where you can actually lose the data forever, and in a few cases the reload notification saved me. (Cases include e.g. git reset --hard.)
I'm still disliking this very much. Just because a file is git managed, it doesn't mean you can't lose parts of its contents. For example, this clears the undo stack. I'd also like more control over this whole thing (this automatism and bugs like #388186 aren't very confidence inducing).
Can you please consider adding an option to disable this behavior? I already lost a bunch of changes because of it. I know other editors reload by default, but that doesn't change that this behavior is fucking dumb.
here Nicolas is working to remove the confirmation: https://bugs.kde.org/show_bug.cgi?id=401376
> I already lost a bunch of changes because of it. The "auto-reload" code checks if there is a matching git blob... https://cgit.kde.org/ktexteditor.git/tree/src/document/katedocument.cpp#n4831 ...so your lost changes should still be there. "git reflog" may helpful. Would be nice when the "undo" action would work in such a case
I get a prompt every time now if a file is modified externally. Can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved. I'm setting status to "needsinfo" pending your response, please change back to "reported" or "resolved" when you respond, thanks.
This happens with the project plugin and files under version control. From what I understand, if the modified file contents were committed to git at some point, kate will always reload it without asking. It works as expected for files not under version control.
This is a feature of KTextEditor. We might want to add a config option to forbid this.
https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/382 Next KTextEditor version will have config option to turn this off.