[Github-comments] [geany/geany] Empty file shouldn't prompt to save when being closed (#1710)

Colomban Wendling notifications at xxxxx
Tue Dec 5 22:40:56 UTC 2017


We consider a file unmodified if it hasn't had modifications since the last saved state: you can see this as matching the last "checkpoint" in the undo history.  As @elextr said, modifications that just so happen to result in the same state are not considered the same, but if you undo your changes until the last checkpoint is reached it'll be considered unmodified (you can tell in several places in Geany's UI).

Yes, we *could* check the differences between the current state and the last known saved state, and if it's the same not bother.  However:
* it has to be done and is harder than what we currently have
* losing undo history might be a problem, so current situation mitigates this
* I don't think it's worth the hassle of implementing it (esp. for a behavior that might not please everyone)
* AFAIK all other apps I know behave the same, which at least means we're not the odd kid in the playground

---
BTW, one could probably write a plugin that somewhat does that by adding a save point (`SCI_SETSAVEPOINT`) when the buffer matches the last one again.  I'm not 100% sure it'd be enough, but it someone really wants this it might be worth trying it out through a plugin.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/1710#issuecomment-349465842
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20171205/aba4db4e/attachment.html>


More information about the Github-comments mailing list