• Login
Community
  • Login

Protect Lines Within Tabs

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
8 Posts 5 Posters 768 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.
  • D
    Douglas Schneider
    last edited by Jun 30, 2023, 5:35 PM

    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

    A 1 Reply Last reply Jun 30, 2023, 6:32 PM Reply Quote 0
    • A
      Alan Kilborn @Douglas Schneider
      last edited by Jun 30, 2023, 6:32 PM

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

      C 1 Reply Last reply Jun 30, 2023, 11:24 PM Reply Quote 3
      • C
        Coises @Alan Kilborn
        last edited by Jun 30, 2023, 11:24 PM

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

        A 1 Reply Last reply Jul 1, 2023, 10:28 AM Reply Quote 1
        • A
          Alan Kilborn @Coises
          last edited by Jul 1, 2023, 10:28 AM

          @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
          • W
            wonkawilly
            last edited by wonkawilly Jul 2, 2023, 6:08 PM Jul 2, 2023, 6:00 PM

            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)

            A 1 Reply Last reply Jul 2, 2023, 6:27 PM Reply Quote 0
            • A
              Alan Kilborn @wonkawilly
              last edited by Jul 2, 2023, 6:27 PM

              @wonkawilly said in Protect Lines Within Tabs:

              Follows a screenshot with the toolbar buttons

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

              W 1 Reply Last reply Jul 2, 2023, 6:49 PM Reply Quote 1
              • W
                wonkawilly @Alan Kilborn
                last edited by wonkawilly Jul 2, 2023, 6:52 PM Jul 2, 2023, 6:49 PM

                @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
                • E
                  Ekopalypse
                  last edited by Jul 4, 2023, 4:40 AM

                  @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
                  4 out of 8
                  • First post
                    4/8
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors