[TxMt] opening a file readonly

Allan Odgaard throw-away-1 at macromates.com
Sat Jul 21 11:52:53 UTC 2007


On 21. Jul 2007, at 13:12, Niels Kobschätzki wrote:

> [...]
> I'm not a developer - wouldn't it be "enough" to disable the save- 
> function for a file that is opened with a "read-only"-option? Or is  
> this just not possible?

Well, enough for the user to not be able to save explicitly, but  
saving can still be done if he has “save when focus is lost” on, if  
he clicks “save changes” when closing the window, or if he runs a  
command that saves the current file. And should we also disable Save  
All Files?

So we probably want to prevent an edit of the buffer, not the actual  
saving (although we may want that as well).

We also need some visual indication for why things are as they are,  
an easy way for the user to change it, the ability for a hook to  
handle editing a read-only file (as is the case with Perforce, where  
an edit of a read-only file should result in a checkout), etc.




More information about the textmate mailing list