Community
    • Login

    Fold by Indent

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 1.5k Views 2 Watching
    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.
    • David BrigdenD Offline
      David Brigden
      last edited by

      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
      • PeterJonesP Offline
        PeterJones
        last edited by

        @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
        • David BrigdenD Offline
          David Brigden
          last edited by

          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
          • PeterJonesP Offline
            PeterJones
            last edited by

            @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

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors