File Manager - edit file, undo changes, save button (red disk) change request

When editing a file, if you make changes, the save icon (floppy disk) changes from black to red to indicate the file has changed.

If you realise you want to undo those changes a ctrl-z will undo the changes. If you ctrl-z a number of times to undo all changes since you opened the file, the save icon remains red.

I’d request the save icon reverts back to black if you revert all changes (and haven’t saved the file during any of the changes).

Reason: makes it easier to know you have reverted the file back to it’s last known unsaved state.
Also: cPanel does this functionality :slight_smile:

Yep!

I’m not sure if that’s possible since we don’t track the actual file changes like an IDE does.

That would be great to have! I’ll take a look, thanks!

Huh, it appears that CodeMirror already tracks an editor’s “clean state” in its undo history, so we can implement that easily!

Try applying this patch, then force-reload the browser page and see if it works for you:

webmin patch https://github.com/webmin/authentic-theme/commit/5306c47
2 Likes

Fabulous! Works a treat. Thank you.

1 Like