From 9a761019da05fbdb546f6e81e294612be217ca12 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 6 Feb 2024 11:16:32 +0100 Subject: vim-patch:f7f33e3719c8 runtime(dosbatch): improve '::' comment highlighting Added a syntax region for command blocks so that the highlighting of `::` comments in them can be controlled. The `dosbatch_colons_comment` variable now controls if all `::` comments in a code block are highlighted as comments or errors. A `::` comment at the end of a command block is always highlighted as an error. This re-enables the highlighting of `::` comments in `.bat` files as requested in vim/vim#13666, while allowing control of highlighting them in command blocks requested in vim/vim#11778 and first attempted in vim/vim#11980. related: vim/vim#11980 fixes: vim/vim#13666 https://github.com/vim/vim/commit/f7f33e3719c87279dfad109b874e2817007a1184 Co-authored-by: Christian Brabandt Co-authored-by: Mike Williams --- runtime/doc/syntax.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index bc5c4a5b3b..0e7c38b38d 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1294,12 +1294,15 @@ Stack Overflow - https://stackoverflow.com/questions/12407800/which-comment-style-should-i-use-in-batch-files -To allow the use of the :: idiom for comments in the Windows Command -Interpreter or working with MS-DOS bat files, set the -dosbatch_colons_comment variable to anything: > +To allow the use of the :: idiom for comments in command blocks with the +Windows Command Interpreter set the dosbatch_colons_comment variable to +anything: > :let dosbatch_colons_comment = 1 +If this variable is set then a :: comment that is the last line in a command +block will be highlighted as an error. + There is an option that covers whether `*.btm` files should be detected as type "dosbatch" (MS-DOS batch files) or type "btm" (4DOS batch files). The latter is used by default. You may select the former with the following line: > -- cgit