Home Download Buy Blog Forum Support

Read only files

Read only files

Postby rbabiak on Sun Oct 25, 2009 12:36 pm

Hi i am really liking Sublime, it really really needs a Find in files :(

What i really want to know, is how can i make it not allow changes to files that are read only. I want it to beep or something so that i know i need to check it out from P4 before making changes.

Any suggestions?
rbabiak
 
Posts: 37
Joined: Sun Oct 25, 2009 12:33 pm

Re: Read only files

Postby rbabiak on Sun Oct 25, 2009 1:09 pm

So there is no default option to prevent editing a file that is read only?
:|
rbabiak
 
Posts: 37
Joined: Sun Oct 25, 2009 12:33 pm

Re: Read only files

Postby rbabiak on Sun Oct 25, 2009 1:17 pm

I don know some python, but haven't figured out how to write stuff that change the editors behavior yet.
Is there a way to put additional functionality to a given file type?
rbabiak
 
Posts: 37
Joined: Sun Oct 25, 2009 12:33 pm

Re: Read only files

Postby rbabiak on Sun Oct 25, 2009 1:59 pm

sublimator wrote:By read only did you simply mean basic file based `read only`?


correct, if the file attribute on disk is set for read only then i can't change the text buffer.
rbabiak
 
Posts: 37
Joined: Sun Oct 25, 2009 12:33 pm

Re: Read only files

Postby rbabiak on Sun Oct 25, 2009 2:53 pm

sublimator wrote:Here's something to tie you over:

This will set the ReadOnly status to that of on disk, every time you activate
the tab (which includes of onLoad)

So if you set it writable, just switch to another tab and back again.



Cool, that works awesome.

I assume there is no sound support in sublime yet?

Is there a easy API for popping up a confirmation box?
rbabiak
 
Posts: 37
Joined: Sun Oct 25, 2009 12:33 pm

Re: Read only files

Postby vim on Sun Oct 25, 2009 3:11 pm

i think you better begin with reading: http://www.sublimetext.com/docs/api-reference
vim
 
Posts: 298
Joined: Tue May 27, 2008 6:51 pm

Re: Read only files

Postby rbabiak on Sun Oct 25, 2009 4:21 pm

vim wrote:i think you better begin with reading: http://www.sublimetext.com/docs/api-reference


Ahhh RTFM!

Right o Sir.

One thing i noticed that the OnModified event doesn't trigger for a readonly buffer. Would it be possible to get a OnMoifiedFailed event.

What i want to do is if you try typing on a read-only buffer it asks if you want to Do Nothing, Check out from P4 or make writable.

just need to detect that you tried to change something that you can't change.
rbabiak
 
Posts: 37
Joined: Sun Oct 25, 2009 12:33 pm


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot] and 20 guests