aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax/dosbatch.vim
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-11-19 22:57:13 +0000
committerJosh Rahm <joshuarahm@gmail.com>2024-11-19 22:57:13 +0000
commit9be89f131f87608f224f0ee06d199fcd09d32176 (patch)
tree11022dcfa9e08cb4ac5581b16734196128688d48 /runtime/syntax/dosbatch.vim
parentff7ed8f586589d620a806c3758fac4a47a8e7e15 (diff)
parent88085c2e80a7e3ac29aabb6b5420377eed99b8b6 (diff)
downloadrneovim-9be89f131f87608f224f0ee06d199fcd09d32176.tar.gz
rneovim-9be89f131f87608f224f0ee06d199fcd09d32176.tar.bz2
rneovim-9be89f131f87608f224f0ee06d199fcd09d32176.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'runtime/syntax/dosbatch.vim')
-rw-r--r--runtime/syntax/dosbatch.vim9
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/syntax/dosbatch.vim b/runtime/syntax/dosbatch.vim
index 55601996ad..0c3e99be3b 100644
--- a/runtime/syntax/dosbatch.vim
+++ b/runtime/syntax/dosbatch.vim
@@ -3,6 +3,7 @@
" Maintainer: Mike Williams <mrmrdubya@gmail.com>
" 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 "\<echo\([^)>|]\|\^\@<=[)>|]\)*"lc=4 contains=dosbatchV
syn match dosbatchEchoOperator "\<echo\s\+\(on\|off\)\s*$"lc=4
" For embedded commands
-syn match dosbatchCmd "(\s*'[^']*'"lc=1 contains=dosbatchString,dosbatchVariable,dosBatchArgument,@dosbatchNumber,dosbatchImplicit,dosbatchStatement,dosbatchConditional,dosbatchRepeat,dosbatchOperator
+syn match dosbatchCmd "(\s*'[^']*'"lc=1 contains=dosbatchString,dosbatchVariable,dosBatchArgument,@dosbatchNumber,dosbatchImplicit,dosbatchStatement,dosbatchConditional,dosbatchRepeat,dosbatchOperator,dosbatchIfOperator
" Numbers - surround with ws to not include in dir and filenames
syn match dosbatchInteger "[[:space:]=(/:,!~-]\d\+"lc=1
@@ -74,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
@@ -102,9 +103,11 @@ else
syn match dosbatchColonCommentErr contained "\s*:\s*:.*$"
endif
syn match dosbatchColonCommentErr contained "\s*:\s*:[^)]*\(\(\n\s*\)\?)\)\@="
-syn region dosbatchCodeBlock transparent start=+(+ end=+)+ contains=dosbatchString,dosbatchVariable,dosBatchArgument,@dosbatchNumber,dosbatchImplicit,dosbatchStatement,dosbatchConditional,dosbatchRepeat,dosbatchOperator,@dosbatchCodeBlockComment,dosbatchColonCommentErr,dosbatchCodeBlock
+syn region dosbatchCodeBlock transparent start=+(+ end=+)+ contains=dosbatchString,dosbatchVariable,dosBatchArgument,@dosbatchNumber,dosbatchImplicit,dosbatchStatement,dosbatchConditional,dosbatchRepeat,dosbatchOperator,dosbatchIfOperator,@dosbatchCodeBlockComment,dosbatchColonCommentErr,dosbatchCodeBlock
syn match dosbatchCodeBlockErr ")"
+syn sync match dosbatchSyncCodeBlock grouphere NONE "^)\s*$"
+
syn keyword dosbatchImplicit append assoc at attrib break cacls cd chcp chdir
syn keyword dosbatchImplicit chkdsk chkntfs cls cmd color comp compact convert copy
syn keyword dosbatchImplicit date del dir diskcomp diskcopy doskey echo endlocal