3 ms·
The reason I do the check that way is because if the user adds a character, and then deletes it, the buffer has not been modified, but if you just set a bool to
by zyedidia 10y ago
The reason I do the check that way is because if the user adds a character, and then deletes it, the buffer has not been modified, but if you just set a bool to true when an insert event happens, it will think the buffer has been modified.
If there is a better way to do this please let me know.
- copperx 10y agoWhat about setting the dirty bit with a boolean while you're working, but then before saving, do the diff to check if the file really needs saving?
- cheez 10y agoIn general, you should optimize for common use cases. In a file editor, you will be modifying the file and when you go to save it, it will be different. What do you gain by doing it this way?