From 78fb387f87deb153cfef243a390e9a55370c35a5 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 17 Aug 2024 11:34:55 +0200 Subject: vim-patch:11c92be: runtime(dosbatch): Add syn-sync to syntax file Closing parentheses were often highlighted as errors. Add a syntax sync command to reduce the error. Also fix that `defined` was not highlighted as an operator inside parentheses. E.g.: ``` if defined foo ( if defined bar ( ... ) ) ``` The first `defined` was highlighted but the second one was not. related: vim/vim#15453 https://github.com/vim/vim/commit/11c92be8974f04ab12ff3f9cd89a692bbd6c46d9 Co-authored-by: Ken Takata --- runtime/syntax/dosbatch.vim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'runtime/syntax/dosbatch.vim') diff --git a/runtime/syntax/dosbatch.vim b/runtime/syntax/dosbatch.vim index 55601996ad..761fac0dc2 100644 --- a/runtime/syntax/dosbatch.vim +++ b/runtime/syntax/dosbatch.vim @@ -3,6 +3,7 @@ " Maintainer: Mike Williams " Filenames: *.bat " Last Change: 3rd February 2024 +" 2024 Aug 14 by Vim Project: improve syntax (#15453) " " Options Flags: " dosbatch_cmdextversion - 1 = Windows NT, 2 = Windows 2000 [default] @@ -45,7 +46,7 @@ syn match dosbatchString "\|]\|\^\@<=[)>|]\)*"lc=4 contains=dosbatchV syn match dosbatchEchoOperator "\ Date: Sat, 17 Aug 2024 11:35:15 +0200 Subject: vim-patch:a1dc649: runtime(dosbatch): Show %%i as an argument in syntax file Inside batch files, for-variables must be written as %%i, not %i. closes: vim/vim#15453 https://github.com/vim/vim/commit/a1dc64956f36cb921d556910c5356bb6b91ba5b9 Co-authored-by: Ken Takata --- runtime/syntax/dosbatch.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/syntax/dosbatch.vim') diff --git a/runtime/syntax/dosbatch.vim b/runtime/syntax/dosbatch.vim index 761fac0dc2..0c3e99be3b 100644 --- a/runtime/syntax/dosbatch.vim +++ b/runtime/syntax/dosbatch.vim @@ -75,7 +75,7 @@ syn match dosbatchSet "\s\h\w*[+-]\==\{-1}" contains=dosbatchIdentifier,dosbatc " Args to bat files and for loops, etc syn match dosbatchArgument "%\(\d\|\*\)" -syn match dosbatchArgument "%[a-z]\>" +syn match dosbatchArgument "%%[a-z]\>" if dosbatch_cmdextversion == 1 syn match dosbatchArgument "%\~[fdpnxs]\+\(\($PATH:\)\=[a-z]\|\d\)\>" else -- cgit