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.Notepad++
like codepen
–
moderator edit: embedded local images instead of trying external image using html wrapper url -
@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.
-
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: -
This is the perfect option!