Community
    • Login

    User Defined Language: Collapse block of text

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    nes
    4 Posts 3 Posters 2.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.
    • CoR--C
      CoR--
      last edited by

      Does anyone know how to create custom user collapsible or foldable sections of text using whitespaces:

      \r\n\t’ as open tag (new line, tab single quote)
      \r\n\t\t as closing tag (new line tab tab)

      New line is forcing folding only at new line, tab is transparent. I am able to create similar thing using spaces. But that is not ideal: no new line, and its easier to see double tab mistake compared to 3 of 5 spaces.

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse @CoR--
        last edited by

        @CoR

        I’m afraid the answer is simple, you can’t. Folding like in python is not supported by UDL.

        1 Reply Last reply Reply Quote 0
        • CoR--C
          CoR--
          last edited by

          So, choices are:
          not possible
          plugin (if it is possible to do it in plugin way)
          a feature request

          :(

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

            @CoR said in User Defined Language: Collapse block of text:

            So, choices are:
            not possible

            natively, correct, it is not currently possible

            plugin (if it is possible to do it in plugin way)

            that would work. plugins can be used to define whole new lexers in the language menu, so yes, a plugin could handle what you wanted, if such a plugin were to be written (I doubt one with that exact feature is already in the Plugins Admin list of plugins).

            With some effort, it could probably also be implemented using the already-existing PythonScript or LuaScript plugin, which allow you to write Python or Lua code to control the Notepad++ GUI and editor windows, including influencing things like syntax highlighting and code folding. My guess is that it would use a similar technique to what @Ekopalypse implemented for regex-based extra-syntax highlighting in this post, but you’d have to find the code-folding rather than text-coloring code to manipulate.

            a feature request

            You could try, yes. However, no new features have been added to User Defined Languages (UDL) system in years, and there are many open bug reports and feature requests for UDL improvements … Sorry that I don’t have better news on that front. :-(

            :(

            Indeed.

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