Community
    • Login

    Folding without closing parentheses or tags

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 686 Views 2 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.
    • Mister SmittM Offline
      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 Offline
        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 Offline
          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 3
          • Mister SmittM Offline
            Mister Smitt @rdipardo
            last edited by

            @rdipardo

            This is the perfect option!

            1 Reply Last reply Reply Quote 1

            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