Community
    • Login

    Can Letters Be Added to the Margin Along with Numbers?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    11 Posts 4 Posters 674 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.
    • dr ramaanandD
      dr ramaanand @Troglo37
      last edited by

      @Troglo37 please give us a “before” and “after” screenshot. How should the output look?

      1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Troglo37
        last edited by

        @Troglo37 ,

        Instead of trying to force Notepad++ to adapt to your rather unique use case, maybe you could try to adapt your own practices slightly to make it match a use case that Notepad++ already has built in.

        If you used a text-based filetype with structure, rather than just a plain text file, for all these notes – like, say, the Markdown that is used when you post to this forum – then you can use already-existing features of Notepad++:

        In Markdown, you can mark a header with # at the start of a line, so your “A, B, C, etc” could be marked as header lines. Example

        filename: movies.md

        # Documentaries
        
        - Name, Year
            - actor 1
            - actor 2
        - Name, year
           - ...
        
        # Animated
        
        - Name, Year
        - Name, Year
        ...
        

        filename: computer-tutorial.md

        # Windows
        - blah
        - blah
        ...
        
        # PowerShell
        - blah
        - blah
        ...
        

        You could then define a FunctionList definition (see my example below) for Markdown that makes each header a “function”, and having the View > Function List turned on would help you navigate to each section inside your file.

        (To have it automatically use the Markdown FunctionList for your file, you would either have to use .md as your info file’s extension, or if you have a custom extension like .trog for all of your “Troglo37’s Notes Files”, then you could add trog to the “Markdown (preinstalled)”'s list of file extensions.

        Here’s my Markdown FunctionList definition, that I use in conjunction with the “Markdown (preinstalled)” UDL that ships with Notepad++

        <?xml version="1.0" encoding="UTF-8"?>
        <!-- ==========================================================================\
        |
        |   To learn how to make your own language parser, please check the following
        |   link:
        |       https://npp-user-manual.org/docs/function-list/
        |
        \=========================================================================== -->
        <NotepadPlus>
            <functionList>
                <parser displayName="Markdown (preinstalled)"
                        id="Markdown (preinstalled)"
                        commentExpr="">
                    <function mainExpr="(?x-s)(^[#]+\s*(.*?)$|^(.*)(?=[\r\n]+^([-=])\4{2,}\s*$))"/>
                </parser>
            </functionList>
        </NotepadPlus>
        
        

        This makes it so that every header row shows up in the FunctionList panel, which makes it easy for me to navigate to the right section.

        And, though I showed using Markdown bullets (lines with the - prefix), you could get away with only using the Header feature of the Markdown language, and get the full functionality of easier navigation inside each of your files.

        —

        Alternatively, you can do some pretty nifty stuff with Scintilla’s Margins – including, IIRC, putting text in a margin (which is how I think Notepad++ does line numbering).
        If you wrote a plugin, or wrote a script for the PythonScript plugin or similar scripting plugin, you could activate another Scintilla margin in Notepad++, and populate that margin as you see fit. However, it would be a part of the UI, not a part of the file, so you’d have to parse the file to figure out where to place your “A,B,C,etc”, which could get complicated. I would think it would be easier to just use # Header Name in your file, give it

        Troglo37T 1 Reply Last reply Reply Quote 3
        • Troglo37T
          Troglo37 @PeterJones
          last edited by

          @PeterJones Thanks for the info. I’m sure other users can find it useful too.

          However, it gave me an idea. I tinkered around and found what I was looking for. I highlighted the text I wanted, then right-click > Style one token. I found this to be highly effective in seeing the start and end points of each section because the colors can easily be seen while scrolling using the Notepad++ scroll bar at high speed.

          I have a few questions about using this feature. I ran into a problem. I colored some text that wasn’t part of the START & END text, the same color. I decided to use a different color. I then highlighted that text and used right-click > Clear style. I was very upset with the result. It cleared all of the text I just painstakingly colored instead of just what I highlighted! Is there a solution for this?

          The next question I have is, is there a way to color ALL of the START & END text even though they all have different names with them at the same time? So far, I can only do everything at the same time if the text is the same. I accomplished that by highlighting START or END, then right-click > Style all occurrences of token.

          For example:

          Tyve START
          Rows of text in between. I DO NOT WANT THE IN-BETWEEN ROWS OF TEXT COLORED
          Tyve END

          Lqtfp START
          Rows of text in between. I DO NOT WANT THE IN-BETWEEN ROWS OF TEXT COLORED
          Lqtfp END

          Jgopub START
          Rows of text in between. I DO NOT WANT THE IN-BETWEEN ROWS OF TEXT COLORED
          Jgopub END

          So, I want ALL of the text before and including START, and the same goes for END to be colored, but nothing else, all at the same time.

          I don’t mind if it can only be done all with START, and then all with END.

          The other question I have is how do I color an empty row? I managed to do it, but for some reason, I can’t duplicate it. I did this by highlighting an empty row along with the START row of text. What in the heck did I do differently?

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

            @Troglo37

            Reading your post about styling as a whole, my conclusion is that you’re not going to be very happy with styling.


            is there a way to color ALL of the START & END text even though they all have different names with them at the same time?

            You might find this marking operation useful:

            e5331046-22cc-4336-b85a-1cad329e619b-image.png

            On your text it produces this result:

            e9ccf93d-afad-4dcf-9061-d674288f5204-image.png

            Troglo37T 1 Reply Last reply Reply Quote 3
            • Troglo37T
              Troglo37 @Alan Kilborn
              last edited by Troglo37

              @Alan-Kilborn Unfortunately, it didn’t work. Did I enter the characters correctly? (?-is)^,*?(?:START|END)$

              My Global background is set to orange and the foreground yellow. I changed the Marking color to turquoise, the color I used for Style token.

              Before trying it, I searched, found, and changed the Marking color. Settings > Style Configurator > Find Mark Style. I changed Brace highlight style and Bad brace colour to turquoise before I saw that Find Mark Style is the option to change it. I did not change the Brace colors back to their default color.

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

                @Troglo37 said in Can Letters Be Added to the Margin Along with Numbers?:

                Did I enter the characters correctly?

                I think you substituted a comma (,) for the period (.).

                Troglo37T 1 Reply Last reply Reply Quote 3
                • Troglo37T
                  Troglo37 @Alan Kilborn
                  last edited by

                  @Alan-Kilborn Thanks! That was the problem. That solution is awesome!

                  Is there a way to tag the Mark operation portion of this thread so users can see it and find it in a search? Or should the title be edited to reflect that part of the thread?

                  BTW, I’m glad that I figured out how to change the color because I couldn’t see the default Mark color while rapidly scrolling via the scroll bar. The default color blends in too much with the orange background.

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

                    @Troglo37 said in Can Letters Be Added to the Margin Along with Numbers?:

                    Is there a way to tag the Mark operation portion of this thread so users can see it and find it in a search?

                    I’m not sure.

                    Or should the title be edited to reflect that part of the thread?

                    I’d say leave it as it is.


                    The default color blends in too much with the orange background.

                    Orange background? Your theme choice must be an interesting one.

                    Troglo37T 2 Replies Last reply Reply Quote 0
                    • Troglo37T
                      Troglo37 @Alan Kilborn
                      last edited by Troglo37

                      @Alan-Kilborn I have to go now, but I’ll post a pic later.

                      1 Reply Last reply Reply Quote 0
                      • Troglo37T
                        Troglo37 @Alan Kilborn
                        last edited by

                        @Alan-Kilborn Here’s a pic of the change log. I used Style one token to illustrate how the colors look. It’s turquoise when that line is clicked. Green when not clicked. Notepad++ Styles-Background.png

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