Community
    • Login

    Bracket Matching in Batch files (.bat)

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 782 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.
    • Brian ZeltB
      Brian Zelt
      last edited by

      The bracket matching doesn’t work in batch files when an IF-ELSE is used. Does anyone know how to correct this? The first group is recognized (@echo.Won’t Happen) but the second one isn’t (@echo.Hello World). Thanks

      @if 1.==2. (
      @echo.Won’t happen
      ) else (
      @echo.Hello World
      )

      Meta ChuhM 1 Reply Last reply Reply Quote 0
      • Meta ChuhM
        Meta Chuh moderator @Brian Zelt
        last edited by Meta Chuh

        @Brian-Zelt

        yes, this is a scintilla editor component issue and present at all scintilla based editors, including the latest Scite 4.1.5.

        but you are not limited to use the integrated lexers only, as notepad++ has the user defined language feature.

        it you e.g. download WinBatch and copy userDefineLang_winbatch.xml to your %AppData%\Notepad++\userDefineLangs\ folder, you can use it as a replacement for the scintilla batch lexer, and it matches all brackets of your example.

        have a look around searching for notepad++ udl or user defined language, maybe you find more that are of interest for you.

        best regards.

        1 Reply Last reply Reply Quote 2
        • Brian ZeltB
          Brian Zelt
          last edited by

          @Meta-Chuh said:

          notepad++ udl

          Hmmm. The file you suggested as a replacement for the Batch language and is not similar to the NP++ Batch language styles at all, and only corrects the ELSE(…) bracket issue. While I can create a user defined UDL, to highlight keywords, I cannot recreate style to be equal to the otherwise usable default Batch UDL. The keyword nor delimiter highlighting does not work the same as the default Batch style.

          1 Reply Last reply Reply Quote 0
          • rinku singhR
            rinku singh
            last edited by

            in code of .bat do

            if “%tjkdrrdiiff%”==“” (goto notselecteditem) else (goto selecteditem)
            :notselecteditem
            bin\filebrowse UNPACK_REPACK_V3.8_FINAL file_contexts.bin,file_contexts,boot.img, “boot.img|boot;file_contexts” > bin\fil76elocate.txt
            set /p tjkdrrdiiff=< bin\fil76elocate.txt
            if “%tjkdrrdiiff%”==“” (goto ejhcnnsjdj)
            :selecteditem
            del /S/Q bin\fil76elocate.txt

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