Avoid "Document changed outside, reload?" message box
-
Hi,
this annoyance constantly occurs when working on remote network drives. I guess NPP checks whether the file’s mtime (last modified timestamp) or size changes after saving and while focusing and editing. However, non-NTFS drives (here: AFS) seem to change the file’s mtime slightly to their granularity, and the prompt occurs.My proposed solution: Before popping up that query, re-read and compare (i.e. verify) entire file content with saved file content. Alternatively, using an internal hash value. When equal, ignore (and take) server-side mtime change and avoid popping-up that query. As an option, limit file compare to some short files, or better, time-limit the verify process so slow connections are not over-used.
-
-
@Henrik-Haftmann, when you do
Ctrl+S
from within Notepad++ are you always or nearly always then immediately getting a file-modified pop-up, This may well be something we can look into.I had thought that when you do
Ctrl+S
that Notepad++ writes the file to disk and it then immediately gets the file’s mtime and size from the disk to use as a baseline for the file-modified logic. If your file system is then changing the mtime to better match someone’s granularity standard then can that behavior be changed? How do applications know when the file system is done with fiddling with the mtime?Your proposal about comparing the file content means that Notepad++ would need to first make a copy of the file the instant someone starts making changes to the file. Notepad++ probably would start making the copy the moment you open the file. We need a copy of the original file to do the comparison you proposed.
Computing a hash would have less overhead
If it were my problem to deal with and I was forced to deal with a file system that keeps fiddling with the mtimes then I would set it up so that I use Notepad++ with local on-disk copies of files and I’d have a background application that synchronizes the local disk files to the external file system. That background application would only change the local disk mtime if and only if the content of the file on the external file system is modified. Basically, I would make my machine part of the AFS network but it would hide the part about that mtimes change.