• Login
Community
  • Login

Text Blocks without end

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 3 Posters 1.5k 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.
  • R
    Railien
    last edited by May 29, 2020, 2:43 PM

    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
    • G
      guy038
      last edited by guy038 May 29, 2020, 4:17 PM May 29, 2020, 4:16 PM

      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
      • R
        Railien
        last edited by Jun 2, 2020, 9:56 AM

        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

        P 1 Reply Last reply Jun 2, 2020, 1:17 PM Reply Quote 0
        • P
          PeterJones @Railien
          last edited by Jun 2, 2020, 1:17 PM

          @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
          • R
            Railien
            last edited by Jun 3, 2020, 7:31 AM

            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
            3 out of 5
            • First post
              3/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors