what is last version of np++ where matching parenthesis was working?
-
hello,
for example, for this kind of nested parenthesis, the highlighting was ok in 6.9.2 but completely broken in 7.8.7,7.8.8,7.8.9 (same code of course!) when there is a space between primitive and ‘(’ …
for ( for ( for ( ) ) )
-
It seems to work fine for me in 7.8.9, so we probably have a case of CLICK HERE.
-
debug info
debug info Notepad++ v7.8.9 (32-bit) Build time : Jul 15 2020 - 20:26:50 Path : C:\Program Files\Notepad++\notepad++.exe Admin mode : OFF Local Conf mode : OFF OS Name : Windows 7 Professional (32-bit) OS Build : 7601.24556 Current ANSI codepage : 1252 Plugins : mimeTools.dll NppConverter.dll NppExport.dll
code example (batch from dostips.com stuff)
for /l %%I in (1,1,%x.len%) do ( for /l %%J in (1,1,%y.len%) do ( set /a "Ii=%%I-1" set /a "Jj=%%J-1" if "!x:~%%I,1!"=="!y:~%%J,1!" ( call set /a "ar[%%I][%%J]=ar[!Ii!][!Jj!]+1" ) ELSE ( call:max ar[%%I][%%J] ar[%%I][!Jj!] ar[!Ii!][%%J] ) ) )
put the cursor on one of last three ‘)’ and see where the highlighting ends up
delete the spaces arround ‘)else(’ , look at it again.just an example, sometimes, depending on the structure, the correct highlighting might be fixed by deleting other spaces elsewhere.
It doesn’t depend on the indentation
behaviour was different with older version (was finding the corresponding opening or ending parenthesis)
-
@Nyaruko-Hayore said in what is last version of np++ where matching parenthesis was working?:
code example (batch from dostips.com stuff)
I believe this is a Scintilla parsing issue in the Windows Batch lexer. I don’t remember this ever working correctly in Notepad++. Are you sure Windows Batch specifically worked as you expected in the 6.9.2 version? I don’t have that version, but I can get 6.9 from the website and it exhibits the same behavior as 7.8.9 for me:
6.9:
7.8.9
Note the brace highlighting works in both versions if you select Normal Text as the parser instead of Windows Batch.
Cheers.
-
@Nyaruko-Hayore said in what is last version of np++ where matching parenthesis was working?:
put the cursor on one of last three ‘)’ and see where the highlighting ends up
Still didn’t see a problem.
This case seems pretty easy.
Batch is a language that is easy to confuse even the best parser, but this case is rather clear cut. -
@Alan-Kilborn said in what is last version of np++ where matching parenthesis was working?:
put the cursor on one of last three ‘)’ and see where the highlighting ends up
Still didn’t see a problem.
The last line won’t exhibit the behavior, but the second to last as in my screenshots will. See the opening parenthesis highlighted is wrong - I should have the opening parenthesis on line 2 highlighted, not line 1.
But again, this has never worked for Windows Batch for me.
See here for Scintilla bug: https://sourceforge.net/p/scintilla/bugs/1624/
and here for Scintilla fix: https://sourceforge.net/p/scintilla/code/ci/bc6bc207a6d4a5ce787b9cb3320c8e1a0b22adb2/Note the fix was April of 2020 so we don’t have that version of Scintilla integrated to Notepad++ yet.
Cheers.
-
@Michael-Vincent said in what is last version of np++ where matching parenthesis was working?:
Are you sure Windows Batch specifically worked as you expected in the 6.9.2 version
and older versions. I agree, it has never been ‘perfect’, also not only with ms-dos, but there was very fewer mismatches.
so, waiting for enhancement in next versions… but meanwhile it’s very disturbing, especially with some ‘esoteric’ ms-dos codes where you can’t add or remove spaces or it won’t work anymore.
thanks for the replies
-
@Nyaruko-Hayore said in what is last version of np++ where matching parenthesis was working?:
waiting for enhancement in next versions
This will require a Scintilla update (within Notepad++), which happens not-so-often.
-
To make things clear the problem is NOT with brace highlighting, it is with Batch lexical analysis.
Brace highlighting only works for the same lexical type of the language.
Put the following into a C file and check which brace is highlighted. Then change the language to normal text and check how it changes./*(*/ ( "(" /*)*/ ) ")"
If you observe the lexical types of Batch in Style Configurator you will see two relevant types: Command and Default.
Based on coloring (without higlighting) you can see that most of the braces are Command except for the one after the ELSE that is Default so it is not matched with Command braces.So what you want is the Batch lexer to be fixed so a brace after else becomes Command (or all others become Default).