[Github-comments] [geany/geany] Hide overwrite button for readonly documents. (PR #3142)

elextr notifications at github.com
Tue Mar 29 16:11:36 UTC 2022


Its an important paradigm to grasp, a "file" is a bunch of bytes on a persistent storage medium, but no modern editor/IDE operates on the file, they operate on a memory structure variously called a "buffer", or as in Geany a "document", and will not touch the file except when you load or save the document.  Thus we have a `File` menu and a `Document` menu, and `Readonly` is in the document menu, ie it applies to the document, not the file.  

If the document has been modified and then is set readonly it can't be changed any more, but it can still be saved to the file, and it is always possible to save-as, even an unmodified readonly document and even to the original file name.  Allowing the overwrite option on the change notification just matches these other file operations.  So any "never write the file" option will have to be respected by all those operations, and there are other operations that save to the file (such as build commands), and the autosave plugin, and any other plugin that can save the document to the file.  So it becomes complicated to actually implement a "never write to the file" option.

Note that when you open the file in two windows you have two copies of Geany running (instances in our terminology) and these do not know about each other.  So if one saves to a file which another has in an open document, and therefore is monitoring for modifications, you will be notified.  It seemed to me that an option removing the annoyance of notifications, along with its attendant "overwrite" button, would be relatively simple and remove the immediate risk for your multiple instance use-case.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3142#issuecomment-1082076567
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/pull/3142/c1082076567 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20220329/e35f2753/attachment.htm>


More information about the Github-comments mailing list