notepad-plus-plus
notepad-plus-plus copied to clipboard
[FEAT] On file reload : do **NOT** flush undo/redo
Description of the Issue
File opened in editor gets modified by external program. The file is updated in the editor (automatically or manually). The previous version is lost forever, the undo/redo arrows are disabled.
Steps to Reproduce the Issue
- See Description just above
Expected Behavior
If file is reloaded due to an external change :
- Store current version in undo history
- Disable redo
- Reload file
- If new version is not wanted, click undo to restore previous version
- If new version modified, keep it in undo, continue as normal
- That's to say we still have "previous" version in undo history
Actual Behavior
- See Description just above
Debug Information
No debug to provide.
This was tried before and was so unsuccessful that it was reverted. I doubt the developers are going to try it again.
In what was it unsuccessful ?
Search old issues/change logs.
@Kochise,
In what was it unsuccessful ?
Cf. https://github.com/notepad-plus-plus/notepad-plus-plus/issues/5626#issuecomment-499858088:
the biggest problem was, that every reload re-populated the undo buffer, regardless if the file itself was modified or not, causing to run out of memory if either done frequently, or reloading huge files.
see here: #5595
and here: https://notepad-plus-plus.org/community/topic/17530/performance-hit-due-to-allow-undo-on-reload/3
Ok, could it be possible to enable it in Preferences.../MISC/File Status Auto-Detection
?
My use case : was editing a self-modifying file, it emptied itself, lost everything as unable to undo.
Should have enabled backup on save, though.
Ok, could it be possible to enable it in Preferences.../MISC/File Status Auto-Detection ?
As I said, I don't think developers are going to revisit anything on this.
was editing a self-modifying file, it emptied itself, lost everything
Meaning you got a prompt to reload and said yes to that prompt?
Nope, no prompt, auto-reloaded itself, cleaned the undo buffer.
What's your setting here:
Also, for developers to consider your issue, provide Debug Information.
What's your setting here:
That's how it is... NOW. Before the two boxes were checked.
Nobody cares how it is NOW; they care how it was when you encountered the conditions of your issue.
Update silently is a bad choice if there is the possibility that you are doing editing of the file and there is the possibility it could be changed by some external process. Perhaps this is obvious now.
Perhaps. The settings are so "hard" to find that I didn't paid attention to it, until it was too late.
The settings are so "hard" to find that I didn't paid attention to it, until it was too late.
Probably best to leave this one at the "default" value (as I showed in the screenshot), unless one really knows what they're doing. I know this is after-the-fact of loss for you; sorry to hear that.
No problem, life is like that. No one was hurt.