• Login
Community
  • Login

Fold by Indent

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
4 Posts 2 Posters 1.1k 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
    David Brigden
    last edited by Jul 19, 2019, 4:20 PM

    As I’ve worked with N++ and languages, I’ve noticed that it will automatically fold( and nest) some of the languages based on the indention.

    This feature is wonderful and I would like to use it when I have a command that I continue on multiple lines.

    I write in a non-standard language. I already use UDL and love it. Is this possible using UDL? is there a plug-in that would do this?

    1 Reply Last reply Reply Quote 0
    • P
      PeterJones
      last edited by Jul 19, 2019, 4:58 PM

      @David-Brigden said:

      Is this possible using UDL? is there a plug-in that would do this?

      As far as I know, UDL will not fold/nest based on indents, only on character sequences. Though if someone can prove me wrong, great!

      It is possible to write a plugin to do that – because it’s theoretically possible to write your own lexer plugin. But I don’t know of any that already exist.

      1 Reply Last reply Reply Quote 2
      • D
        David Brigden
        last edited by Jul 21, 2019, 6:19 PM

        That’s what I figured. Guess I just leave those long lines alone manually wrap inside a region

        1 Reply Last reply Reply Quote 0
        • P
          PeterJones
          last edited by Jul 22, 2019, 1:10 PM

          @David-Brigden said:

          Guess I just leave those long lines alone manually wrap inside a region

          Maybe I misunderstood. Fold/nest (which I was talking about) implies the hiding of lines from a block structure, such as a c-function, like

          ⊟ int blah(args) {
              int a = 1;
              int b = 2;
            }
          ⊟ double yo(args) {
              double a = 1;
              double b = 2;
            }
          

          being collapsed down to

          ⊞ int blah(args) {
          ⊞ double yo(args) {
          

          Whereas “long lines … wrap” is a completely different setting (View > Word Wrap or equivalent toolbar icon), and just converts

          13    Pretend this line... is very, very long
          14    And another line
          

          into

          13    Pretend this line...
                is very, very long 
                (but now it is wrapped)
          14    And another line
          
          1 Reply Last reply Reply Quote 3
          4 out of 4
          • First post
            4/4
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors