Community
    • Login

    User Defined Language: Collapse block of text

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    nes
    4 Posts 3 Posters 3.5k Views 1 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.
    • CoR--C Offline
      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 Offline
        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 Offline
          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 Offline
            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

            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