Protect Lines Within Tabs
Question: Is there a way to protect lines within tabs without having to protect an entire tab? I have notes at the top of some tabs that I want to protect from being edited (I have fat fingers).
I Googled for a solution, but didn’t find anything. So…
In the attached markup, I want to protect the content in the red/green box from editing and/deletion, but the rest of the page can be edited normally.
Even if there is a plugin (I Googled that also), but didn’t find anything.
Is this an existing thing, or can I make the suggestion to implement such a thing in a future release?
Perhaps it could be useful a work around: to fold or hide those lines that you don’t want to edit by hands (such procedure will not prevent to modify the lines with other tools as for instance Find and Replace etc…).
Follows a screenshot with the toolbar buttons useful if you like to use the 2 suggested workarounds.
Also, if you wish just to fold the rows, you could create and use a custom language the way as shown by the following animation:
Animation here: https://imgur.com/a/MB1qQCU
(I could not put an .apng nor a.mp4 file into this post so to actually see the animation. So unfortunately you have to follow the above link and click on the shown image there to start the animation and put it in full view mode. I am sorry for the inconvenient. Also if someone is able to embed directly in this thread, please do because I am not able to, thank you in advance)
@Alan-Kilborn thank you for the notice
Right, I forgot: it is necessary to install the Customize Toolbar plugin and show them from there, because they are hidden by default.
without having more information about how exactly such a feature is supposed to work, it’s hard to say whether locking part of a text with this style attribute is sufficient. For example, if this “locking” only happens after several edits, I’d be surprised if a few “undos” didn’t reset the text. Never tested it.
@Douglas-Schneider - there is a possibility that a Python script could be used via the PythonScript plugin, but one would need more information on how it should work.
Questions I’m thinking of include.
Are the files only on the hard drive or also on the network, on a USB drive, etc.?
Is the file only ever edited by one person, or perhaps multiple users?
Is the area locked when the file is loaded or at any time?
Does only text need to be locked for files that don’t use another lexer, e.g. text doesn’t have a lexer, but xml or json files do.
What must be done when ending a npp session or closing the file or starting npp and loading a file?
If you can specify your requirement and are willing to go the a python script solution way, we might be able to offer you something.