can i use function list in Notepad++ 7.9.5?
-
FYI, I followed Peter’s instructions and it worked perfectly.
I was somewhat of a risk-taker and skipped step 1, with no problems. :-) -
I notice that the dynamic highlight color in the Function List of the function your caret is in in the editor window is rather subtle (using the default theme).
In case it is unclear, I mean as you caret around in your main document area, the Function List shows you which “function” you are currently in.
I don’t mean when you click on a function in the FL window – when I do that, the background highlight of the function clicked is suitably contrasting.For me the background coloring is much more subtle than your screenshot shows for
## Another Level 2
.Is there a technique for making this more visible (i.e., making the background color of that function name darker)?
This feels like it might have been something discussed before?
-
Hello @bge-low, @peterjones, @alan-kilborn and All,
After some tests on our
NodeBB
forum and some searches on legalMarkdown
syntax, I think that we should change the present syntax :<function mainExpr="(?x-s)(^[#]+\s*(.*?)$|^(.*)(?=[\r\n]+^([-=])\4{2,}\s*$))"/>
into this new one :
<function mainExpr="(?-s)^#{1,6}(?:(?=[\t\x20]*$)|[\t\x20]+\K.+)|^.+(?=\R\x20{0,3}[-=]+[\t\x20]*$)"/>
You may test it against this text, using the
Markdown (preinstalled)
language :Line 1 Line 2 ###### HEADER Text of level 6 Line 3 Line 4 Line 5 is a HEADER line ======= Line 6 Line 7 is ALSO a HEADER line - Line 8 Line 9 # Level 1 HEADER Text Line 10 : the NEXT line is an EMPTY HEADER text ### Line 11 Line 12
With the
free-spacing
mode, this regex can be re-expressed as below :(?x-s) # FREE-SPACING mode and any DOT matches a SINGLE STANDARD char ONLY ^ \# {1,6} # From 1 to SIX '#' characters ... (?: # START of a NON capturing group 1 (?= [\t\x20]* $ ) # IF followed with POSSIBLE TAB or SPACE character(s) till the END of CURRENT line | # OR [\t\x20]+ # followed with, at least, one TAB or SPACE character \K .+ # and, AFTER a RESET, followed with the REMAINDER or CURRENT line ) # END of the NON-CAPTURING group 1 | # OR ^.+ # CURRENT line contents ... (?= # Start of a POSITIVE look-ahead \R\x20{0,3} # IF followed with A LINE-BREAK, and from ZERO to THREE SPACE character(s) [-=]+ # followed with, at least, ONE DASH or EQUAL sign [\t\x20]*$ # Followed with POSSIBLE TAB or SPACE character(s) till the END of CURRENT line ) # END of the POSITIVE look-ahead
Best Regards,
guy038
-
@PeterJones
thanks peter.your tutorial worked perfectly.but i still have other question.
can the function list be “fold” like vs code?
header1 locate in top,header2 and header3 locate in under of header1. -
@bge-low said in can i use function list in Notepad++ 7.9.5?:
but i still have other question.
can the function list be “fold” like vs code?I think Peter answered this one:
As you can see, it doesn’t make a multi-layer hierarchy
So the very short answer is No.
-
thanks for comment.do i have to develop for folding function?
that looks like very hard. -
@bge-low said in can i use function list in Notepad++ 7.9.5?:
do i have to develop for folding function?
If you want that feature, I’d say Yes.
Otherwise you can make a FEATURE REQUEST for the N++ developers, but that offers no guarantee of implementation. -
thanks for comment.
i may have to make plugin.
https://npp-user-manual.org/docs/plugins/ -
@PeterJones Thanks so much for documenting this. There are several older posts on various sites about how to modify the Function List, but they no longer work since Notepad++ introduced newer mechanisms for managing all this, e.g. overrideMap.xml.
It should be noted that there seems to be a bug in Notepad++ related to this.
You must make the file changes above within the
%AppData%\Notepad++\functionList
dir, which means it has to be done separately for each user of the PC.Trying to instead make the same changes for all users of the PC, within the
C:\Program Files\Notepad++\functionList
dir, results in Notepad++ entirely ignoring the configuration.Given that the
C:\Program Files\Notepad++\functionList
dir exists and has the same files, including the overrideMap.xml mechanism, leads me to think that its being ignored is a bug in Notepad++. -
@Dan-Ignat-0 said in can i use function list in Notepad++ 7.9.5?:
It should be noted that there seems to be a bug in Notepad++ related to this. …
Makes sense, but we cannot do anything about it in the Community Forum. If you want the developer to hear your thoughts, follow our Feature Request / Bug FAQ to put your request in the official tracker.
-
@Dan-I-2072 said in can i use function list in Notepad++ 7.9.5?:
You must make the file changes above within the
%AppData%\Notepad++\functionList
dir, which means it has to be done separately for each user of the PC.Trying to instead make the same changes for all users of the PC, within the
C:\Program Files\Notepad++\functionList
dir, results in Notepad++ entirely ignoring the configuration.The all users path might be
%ProgramData%\Notepad++\functionList
or the older Environmental Variable path of%ALLUSERSPROFILE%\Notepad++\functionList
. I do not know if Notepad++ searches in those paths.