Community
    • Login

    Folding without closing parentheses or tags

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 95 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.
    • Mister SmittM
      Mister Smitt
      last edited by PeterJones

      How do I fold code while preserving closing tags and parentheses?
      The lone opening parenthesis sticking out looks strange to me.

      Notepad++
      86a19f68-1700-4532-b4c3-49e41c35abd1-17598434988543538289517847796195.gif

      like codepen
      4281d830-0d90-48b3-9b8a-a281be9509c8-17598435463865873400698155454808.gif

      –
      moderator edit: embedded local images instead of trying external image using html wrapper url

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

        @Mister-Smitt said in Folding without closing parentheses or tags:

        How do I fold code while preserving closing tags and parentheses?
        The lone opening parenthesis sticking out looks strange to me.

        As far as I am aware, the underlying Scintilla library which Notepad++ uses for the folding and syntax highlighting does not offer a way to configure whether or not to hide the closing element when folding. Unless I have missed something in their folding documentation, I believe that the configurable feature would have to be added to Scintilla, and then Notepad++ would have to provide that feature through its configuration interface. (I admit that I am not an expert on Scintilla folding, but I don’t believe it’s possible. If someone else knows how to get Scintilla to do it, then feel free to correct me.)

        So, as far as I know, there’s nothing that Notepad++ can do to give you that feature, unless the underlying library were improved by its team first.

        update: I was apparently wrong. See below.

        rdipardoR 1 Reply Last reply Reply Quote 0
        • rdipardoR
          rdipardo @PeterJones
          last edited by rdipardo

          @Mister-Smitt, @PeterJones

          Yes, alternative folding styles are possible. They just have to be implemented in the Notepad++ application code.

          According to the relevant Scintilla documentation:

          The marker numbers SC_MARKNUM_FOLDER and SC_MARKNUM_FOLDEROPEN are used for showing that a fold is present and open or closed. […] [M]ore assignments are needed for the flattened tree style: SC_MARKNUM_FOLDEREND, SC_MARKNUM_FOLDERMIDTAIL, SC_MARKNUM_FOLDEROPENMID, SC_MARKNUM_FOLDERSUB, and SC_MARKNUM_FOLDERTAIL.

          For example, the Notepad4 editor provides SC_MARKNUM_FOLDERTAIL as the default style, which creates the dotted boxes shown below:

          np4_SC_MARKNUM_FOLDERTAIL.png

          Mister SmittM 1 Reply Last reply Reply Quote 2
          • Mister SmittM
            Mister Smitt @rdipardo
            last edited by

            @rdipardo

            This is the perfect option!

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