Set Read-Only Edit function feature request
-
Would it be possible to add the term “Read-Only” to the Status Bar when you set the document into Read-Only. I think at one time it did this, but I could be wrong.
Or to add to this, another feature similar to the clickable “INS/OVR” toggle in the current Status Line, add “Write/Read-Only” clickable toggle as well. Then I do not have to bother with selection under the Edit menu.
Thanks!
-
do you know that you can also use the context menu (right click on tab)
and/or assign a shortcut to the action?Cheers
Claudia -
Yes. I just would like a visual that I can just look down and spot. Of course in Read-Only mode it does not allow me to type into the file. I wish it would so I could still mark it up and then use copy and paste elsewhere. If Read-Only mode it should just not allow me to save the file.
Thanks for your reply.
-
As I pointed out in another thread, there is a visual indication of being in read-only mode.
I’ll admit, it’s rather subtle (with how small the icons are, the grey disk icon next to the read-only version is hard to distinguish from the blue disk icon next to the writable version), but it’s there.
If you want to quickly be able to toggle, you could set up shortcuts using
Settings
>Shortcut Mapper
>Main Menu
: -
Regarding the visual status indication in the status bar, here’s a quick-and-dirty way of adding an “attrib”-command-style “+r” (for read-only) or “-r” (for read/write) status. Be aware that this doesn’t necessarily reflect the OS’s real attribute on the file (it could), but merely the status of the Notepad++ editor buffer.
Note that this solution to the “problem” requires the Pythonscript plugin, not sure if setting that up (if you don’t already have it) outweighs the benefit of having the status bar modified…
Step 1: Install Pythonscript plugin if not already installed, for details, see https://notepad-plus-plus.org/community/topic/13045/regex-select-match-the-numbers-that-are-repeated-most-often and search for text “What needs to be done first is described here” within that posting.
Step 2: Copy the script in this posting: https://notepad-plus-plus.org/community/topic/13087/sel-in-status-bar-is-off-by-1-on-line-count/6
Step 3: Change these few lines in that script:
line_col_sel_info_for_sb = 'Ln : {user_line} Col : {user_col} Sel : {sel}'.format( user_line=curr_line+1, user_col=curr_col+1, sel=sel_part, )
to this:
line_col_sel_info_for_sb = 'Ln : {user_line} Col : {user_col} Sel : {sel} {ro}r'.format( user_line=curr_line+1, user_col=curr_col+1, sel=sel_part, ro='+' if editor.getReadOnly() else '-' )
Step 4: Run the script and/or add to startup.py
Step 5: Enjoy seeing the read/write status for the active editor tab in the line/column/selection area of the status bar, like this:
Ln:229 Col:103 +r
-
Minor correction to the sample output, forgot the “Sel” part earlier. It should actually look like this:
Ln:229 Col:103 Sel: 0|0 +r