When I call "Macros / Files / Toggle ReadOnly", it changes not only readonly status of the buffer but also the permissions of the file.
I want another "ReadOnly", which would make the buffer read-only WITHOUT changing the file attributes.
This is useful when I view a mission-critical file, in order not to damage it incidentally.
Is this macro sufficient?
It will copy the whole file content to a new file.
I believe this feature should be in the core.
Hmmm…
I just tested with jEdit 05.04.99.00 on Mac OS X 10.12.6 (x86_64)
I opened a read-only file and had no issues editing it. No need to change a read-only mode.
But when I tried to save, I was asked whether or not I want to reset the read-only mode of the file.
So I think it can be closed as fixed.
This is not what the creator asked for.
The request is about "editing lock" of a buffer, not a file, as title states.
Oops…
Completely misunderstood.
In theory, this should make a buffer readonly:
In practice it didn't work on my Mac. I still can edit the file.
There is an 'isEditable' method in Buffer. I believe this is a request for a 'setEditable(true/false)' method, yes?
I've looked through the code and this is easy to implement at the buffer level, but I'm not sure where to put the setting. Should it be a checkbox in the Open dialog? In the buffer options? Both?
I checked in the API change in revision 24779. There is no gui to set it yet, but it is testable by using beanshell: Utilities - Beanshell - Evaluate Beanshell Expression, enter buffer.setEditable(false). This will make the current buffer non-editable. Use buffer.setEditable(true) to restore editing capabilities.
I'd use "locked" instead of "editable". According to the code editable status used as more generic term, which can have many reasons. While "locked" state can be the one of those reasons itself. What do you think?
Why not use widget in the status bar? I just made one while was learning, attached.
Last edit: Roman Tsourick 2017-11-20
I think, I can implement the buffer option also, if there are no objections to my idea of "L". Dale, do you mind if I take over?
It's not assigned to me :)
Patch: https://sourceforge.net/p/jedit/patches/612/