• Login
Community
  • Login

Colour code nested brackets

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
4 Posts 3 Posters 5.7k 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.
  • B
    BENielsen
    last edited by Feb 16, 2018, 3:35 PM

    Could someone help me find or create something that will make notepad++ colour code nested brackets?

    Example: [green [blue [red] blue] green [blue [red [purple] red] blue] green]

    S 1 Reply Last reply Feb 16, 2018, 3:51 PM Reply Quote 0
    • S
      Scott Sumner @BENielsen
      last edited by Feb 16, 2018, 3:51 PM

      @BENielsen

      Not exactly what you’re looking for, but maybe what is suggested here could meet your need?

      Note: You didn’t state the reason for your desire, you simply stated your desire. If you provide your reasoning, you give the responders here more to work with (when providing similar alternatives that might work for you).

      1 Reply Last reply Reply Quote 0
      • B
        BENielsen
        last edited by Feb 16, 2018, 6:34 PM

        I’m working on a couple of macro programs for a cnc, and the logic can get a little tough to follow at a glance. Having colour coding would simplify things a lot for me, especially when it gets heavier than this (up to 27 levels of nesting).

        Here’s an example of the code:
        IF [#181GT#[45000+#[900+#900]]] GOTO99

        I’m also working with nested loop statements that run from the line ending in DO1 to END1(DO2 to END2 and so on)
        in this case coding the loops so that each level of nesting has its own colour would be helpful.

        Here’s an example of that:
        #152=1
        WHILE[#152LE40]DO1
        WHILE[#[45000+#152]EQ0]DO2
        #[45000+#152]=1
        #[500+#152]=#[500+#152]+1
        END2
        #152=#152+1
        END1
        (RESET USED VARIABLES)
        #152=#0

        C 1 Reply Last reply Feb 16, 2018, 10:53 PM Reply Quote 0
        • C
          Claudia Frank @BENielsen
          last edited by Claudia Frank Feb 16, 2018, 10:55 PM Feb 16, 2018, 10:53 PM

          @BENielsen

          not sure if this helpful but up to 8 levels can be done with UDL (Language->define your language).
          You just need to make sure that you allow nesting for all delimiters
          and of course use different color.

          Cheers
          Claudia

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