Community
    • Login

    Text Blocks without end

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 1.4k 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.
    • RailienR
      Railien
      last edited by

      Hi,

      I defined a language and want to use text blocks in notepad++. But normaly you have to define an end, like:

      /start
      ...
      ...
      /end
      

      But in the language I want to use is no end sign. So can I define the end as a line before a new start line? Like:

      *some_text
      ...
      ...
      $ a comment
      ...
      ...
      last line
      *some_new_text
      ...
      last line
      *end
      

      Finally I want to end the blocks in the “last line”. Normally there is a misc. text an no keyword or sign.

      Thanks.

      1 Reply Last reply Reply Quote 0
      • guy038G
        guy038
        last edited by guy038

        Hello @railien and All,

        Why not this following road map ?


        • Open a new file ( Ctrl + N )

        • Paste the text, below :

        *FIRST block
        
        
          This is
          a text
          of a group
          of lines
        
        
        *SECOND block
          bla bla
          ... ...
          ... ...
        
        
          ... ...
          ... ...
        *THIRD block
        
        
        
        *LAST block
        Here is
        the final
        group
        
        • Select the Language > User-Defined for this new file

        • Then, open the User Defined Language > Define your language... dialog

        • Select the Folder & Default tab

        • In Folding in code1 style:, just type in a * symbol in the Middle box

        Voila ;-))

        Best Regards,

        guy038

        1 Reply Last reply Reply Quote 2
        • RailienR
          Railien
          last edited by

          Hello guy038,

          thanks for your answer. I’ve already tried this. In that case, if I fold the first block, everything ist folded. But I want the second block to be unfolded.

          Maybe the question was a bit different. I want an end of the folding, but one line bevor the next start line. The start line (second block) should not be linked to the first block. This what I get when I do so as you proposed.

          Best Regards
          Railien

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

            @Railien said in Text Blocks without end:

            if I fold the first block, everything ist folded.

            Then you did not follow @guy038’s directions. Notice that he only defined the middle folding, nothing else.

            Using your original data, I followed his instructions, and got exactly the behavior you described. See my animation below:

            1 Reply Last reply Reply Quote 4
            • RailienR
              Railien
              last edited by

              Thank you PeterJones,

              that’s it.
              I’ve even tried that, but somehow did’t see the functionality.

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