Community
    • Login

    Protect Lines Within Tabs

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    8 Posts 5 Posters 757 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Douglas SchneiderD
      Douglas Schneider
      last edited by

      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?

      Thank you,
      Notepad++ Lock Lines.jpg

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Douglas Schneider
        last edited by

        @Douglas-Schneider said in Protect Lines Within Tabs:

        Is this an existing thing,

        No.

        or can I make the suggestion to implement such a thing in a future release?

        You may, see HERE, but as it is a rather esoteric request, I doubt it would be implemented.

        CoisesC 1 Reply Last reply Reply Quote 3
        • CoisesC
          Coises @Alan Kilborn
          last edited by

          @Alan-Kilborn I’m really not familiar with Python or how to use that scripting interface, but would a relatively simple script using SCI_STYLESETCHANGEABLE be able to do it?

          I agree there is pretty slim chance of it being implemented as a built-in feature.

          Alan KilbornA 1 Reply Last reply Reply Quote 1
          • Alan KilbornA
            Alan Kilborn @Coises
            last edited by

            @Coises said in Protect Lines Within Tabs:

            but would a relatively simple script using SCI_STYLESETCHANGEABLE be able to do it?

            Hmm, I’m not sure. Styling in general is something I’m not into (lack of personal need). @Ekopalypse is way of more a styling expert, perhaps he’d care to comment?

            1 Reply Last reply Reply Quote 0
            • wonkawillyW
              wonkawilly
              last edited by wonkawilly

              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.

              83fb6afc-86c8-4d3e-a9fb-a148aa1520bc-image.png

              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 KilbornA 1 Reply Last reply Reply Quote 0
              • Alan KilbornA
                Alan Kilborn @wonkawilly
                last edited by

                @wonkawilly said in Protect Lines Within Tabs:

                Follows a screenshot with the toolbar buttons

                I don’t believe those toolbar buttons belong to Notepad++…

                wonkawillyW 1 Reply Last reply Reply Quote 1
                • wonkawillyW
                  wonkawilly @Alan Kilborn
                  last edited by wonkawilly

                  @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.

                  1 Reply Last reply Reply Quote 0
                  • EkopalypseE
                    Ekopalypse
                    last edited by

                    @Alan-Kilborn @Coises

                    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?
                    Etc …
                    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.

                    1 Reply Last reply Reply Quote 4
                    • First post
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors