Community
    • Login

    what is last version of np++ where matching parenthesis was working?

    Scheduled Pinned Locked Moved General Discussion
    9 Posts 4 Posters 407 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.
    • Nyaruko HayoreN
      Nyaruko Hayore
      last edited by

      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 (
          )
        )
      )
      
      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Nyaruko Hayore
        last edited by

        @Nyaruko-Hayore

        It seems to work fine for me in 7.8.9, so we probably have a case of CLICK HERE.

        1 Reply Last reply Reply Quote 1
        • Nyaruko HayoreN
          Nyaruko Hayore
          last edited by

          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)

          Michael VincentM Alan KilbornA 2 Replies Last reply Reply Quote 0
          • Michael VincentM
            Michael Vincent @Nyaruko Hayore
            last edited by Michael Vincent

            @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:
            d8512a9a-9f6f-4c97-b28c-19d24c98fedd-image.png

            7.8.9
            65a0d1b4-b639-4c6d-be17-6377c2b3b78d-image.png

            Note the brace highlighting works in both versions if you select Normal Text as the parser instead of Windows Batch.

            Cheers.

            1 Reply Last reply Reply Quote 4
            • Alan KilbornA
              Alan Kilborn @Nyaruko Hayore
              last edited by

              @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.

              Michael VincentM 1 Reply Last reply Reply Quote 0
              • Michael VincentM
                Michael Vincent @Alan Kilborn
                last edited by

                @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.

                1 Reply Last reply Reply Quote 2
                • Nyaruko HayoreN
                  Nyaruko Hayore
                  last edited by

                  @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

                  Alan KilbornA 1 Reply Last reply Reply Quote 2
                  • Alan KilbornA
                    Alan Kilborn @Nyaruko Hayore
                    last edited by

                    @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.

                    1 Reply Last reply Reply Quote 0
                    • gstaviG
                      gstavi
                      last edited by

                      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).

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