Mercurial > vim
annotate runtime/ftplugin/dosbatch.vim @ 34481:de28179cc9cd
runtime(sh): Update syntax file, fix issue #962 (#14138)
Commit: https://github.com/vim/vim/commit/1bdc9435c1a14ca1a30e5b5927ab63f603ec4409
Author: dkearns <dougkearns@gmail.com>
Date: Tue Mar 5 05:14:08 2024 +1100
runtime(sh): Update syntax file, fix issue https://github.com/vim/vim/issues/962 (https://github.com/vim/vim/issues/14138)
Allow the opening parenthesis of a multiline array assignment, within an
if statement, to appear at EOL.
Fixes issue #962.
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 04 Mar 2024 19:15:06 +0100 |
parents | 8ae680be2a51 |
children |
rev | line source |
---|---|
7 | 1 " Vim filetype plugin file |
32004 | 2 " Language: MS-DOS/Windows .bat files |
3 " Maintainer: Mike Williams <mrmrdubya@gmail.com> | |
4 " Last Change: 12th February 2023 | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
32004
diff
changeset
|
5 " 2024 Jan 14 by Vim Project (browsefilter) |
32004 | 6 " |
7 " Options Flags: | |
8 " dosbatch_colons_comment - any value to treat :: as comment line | |
7 | 9 |
10 " Only do this when not done yet for this buffer | |
11 if exists("b:did_ftplugin") | |
12 finish | |
13 endif | |
14 | |
15 " Don't load another plugin for this buffer | |
16 let b:did_ftplugin = 1 | |
17 | |
3513 | 18 let s:cpo_save = &cpo |
19 set cpo&vim | |
20 | |
7 | 21 " BAT comment formatting |
32004 | 22 setlocal comments=b:rem,b:@rem,b:REM,b:@REM |
23 if exists("dosbatch_colons_comment") | |
24 setlocal comments+=::: | |
25 setlocal commentstring=::\ %s | |
26 else | |
27 setlocal commentstring=REM\ %s | |
28 endif | |
7 | 29 setlocal formatoptions-=t formatoptions+=rol |
30 | |
20317 | 31 " Lookup DOS keywords using Windows command help. |
32 if executable('help.exe') | |
33 if has('terminal') | |
34 setlocal keywordprg=:term\ help.exe | |
35 else | |
36 setlocal keywordprg=help.exe | |
37 endif | |
38 endif | |
39 | |
7 | 40 " Define patterns for the browse file filter |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
32004
diff
changeset
|
41 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
32004
diff
changeset
|
42 let b:browsefilter = "DOS Batch Files (*.bat, *.cmd)\t*.bat;*.cmd\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
32004
diff
changeset
|
43 if has("win32") |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
32004
diff
changeset
|
44 let b:browsefilter ..= "All Files (*.*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
32004
diff
changeset
|
45 else |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
32004
diff
changeset
|
46 let b:browsefilter ..= "All Files (*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
32004
diff
changeset
|
47 endif |
7 | 48 endif |
3492 | 49 |
20317 | 50 let b:undo_ftplugin = "setlocal comments< formatoptions< keywordprg<" |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
32004
diff
changeset
|
51 \ . "| unlet! b:browsefilter" |
3513 | 52 |
53 let &cpo = s:cpo_save | |
54 unlet s:cpo_save |