• Login
Community
  • Login

User Defined Language: Collapse block of text

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
nes
4 Posts 3 Posters 2.9k 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.
  • C
    CoR--
    last edited by May 19, 2020, 10:39 PM

    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.

    E 1 Reply Last reply May 20, 2020, 6:09 AM Reply Quote 0
    • E
      Ekopalypse @CoR--
      last edited by May 20, 2020, 6:09 AM

      @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
      • C
        CoR--
        last edited by May 20, 2020, 11:59 AM

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

        :(

        P 1 Reply Last reply May 20, 2020, 1:25 PM Reply Quote 0
        • P
          PeterJones @CoR--
          last edited by May 20, 2020, 1:25 PM

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