mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
runtime(vim): Update syntax, improve user-command matching
- Match -addr and -keepscript attributes and generate -addr values. - Match attribute errors where = is specified. - Highlight attributes with Special like other Ex command options. - Don't highlight user-specified completion function args. - Match :delcommand -buffer attribute. closes: #15586 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
84e3175c4e
commit
3c07eb0c67
@@ -4,7 +4,7 @@
|
||||
@2|"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@46
|
||||
|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
|
||||
> @74
|
||||
|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|-+0#af5f00255&|c+0#e000e06&|o|u|n|t| +0#0000000&|F|o@1|C|o|m@1|a|n|d| |{+0#e000e06&| +0#0000000&@47
|
||||
|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|-+0#e000e06&|c|o|u|n|t| +0#0000000&|F|o@1|C|o|m@1|a|n|d| |{+0#e000e06&| +0#0000000&@47
|
||||
| +0#0000e05&@1|#| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| +0#0000000&@51
|
||||
@2|"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@46
|
||||
|}+0#e000e06&| +0#0000000&@73
|
||||
|
@@ -14,7 +14,7 @@
|
||||
@2|"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@46
|
||||
|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
|
||||
@75
|
||||
|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|-+0#af5f00255&|n+0#e000e06&|a|r|g|s|=+0#af5f00255&|1+0#00e0003&| +0#0000000&|F|o@1|C|o|m@1|a|n|d| |{+0#e000e06&| +0#0000000&@45
|
||||
|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|-+0#e000e06&|n|a|r|g|s|=|1+0#00e0003&| +0#0000000&|F|o@1|C|o|m@1|a|n|d| |{+0#e000e06&| +0#0000000&@45
|
||||
| +0#0000e05&@1|#| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| +0#0000000&@51
|
||||
@2|"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@46
|
||||
@57|1|,|1| @10|T|o|p|
|
||||
|
@@ -1,7 +1,7 @@
|
||||
| +0&#ffffff0@1|"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@46
|
||||
|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
|
||||
@75
|
||||
|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|-+0#af5f00255&|n+0#e000e06&|a|r|g|s|=+0#af5f00255&|1+0#00e0003&| +0#0000000&|F|o@1|C|o|m@1|a|n|d| |{+0#e000e06&| +0#0000000&@45
|
||||
|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|-+0#e000e06&|n|a|r|g|s|=|1+0#00e0003&| +0#0000000&|F|o@1|C|o|m@1|a|n|d| |{+0#e000e06&| +0#0000000&@45
|
||||
| +0#0000e05&@1|#| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| +0#0000000&@51
|
||||
@2>"+0#e000002&|u|s|e|l|e|s@1| |s|t|r|i|n|g|"| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@46
|
||||
|}+0#e000e06&| +0#0000000&@73
|
||||
|
@@ -1,20 +1,20 @@
|
||||
>"+0#0000e05#ffffff0| |V|i|m| |:|c|o|m@1|a|n|d| |c|o|m@1|a|n|d| +0#0000000&@52
|
||||
>"+0#0000e05#ffffff0| |V|i|m| |:|c|o|m@1|a|n|d|,| |:|d|e|l|c|o|m@1|a|n|d| |a|n|d| |:|c|o|m|c|l|e|a|r| |c|o|m@1|a|n|d|s| +0#0000000&@24
|
||||
@75
|
||||
|"+0#0000e05&| |I|s@1|u|e| |#|1|4|1|3|5| +0#0000000&@60
|
||||
@75
|
||||
|c+0#af5f00255&|o|m| +0#0000000&|F|o@1| |c+0#af5f00255&|a|l@1| +0#0000000&|s+0#00e0e07&|y|s|t|e|m|(+0#0000000&|'+0#e000002&|l|s|'|)+0#0000000&| @49
|
||||
|~+0#4040ff13&| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
| +0#0000000&@56|1|,|1| @10|A|l@1|
|
||||
|"+0#0000e05&| |l|i|s|t| +0#0000000&@68
|
||||
@75
|
||||
|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&@67
|
||||
|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|F| @65
|
||||
@75
|
||||
|"+0#0000e05&| |d|e|f|i|n|e| +0#0000000&@66
|
||||
@75
|
||||
|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&@1|F|o@1| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@51
|
||||
|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|F|o@1| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@51
|
||||
|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|F|o@1| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|B|a|r|"| +0#0000000&@38
|
||||
@75
|
||||
|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|F|o@1| |{+0#e000e06&| +0#0000000&@60
|
||||
@2|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@62
|
||||
@2|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|B|a|r|"| +0#0000000&@62
|
||||
@2|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|B|a|z|"| +0#0000000&@62
|
||||
|}+0#e000e06&| +0#0000000&@73
|
||||
@57|1|,|1| @10|T|o|p|
|
||||
|
20
runtime/syntax/testdir/dumps/vim_ex_command_01.dump
Normal file
20
runtime/syntax/testdir/dumps/vim_ex_command_01.dump
Normal file
@@ -0,0 +1,20 @@
|
||||
| +0&#ffffff0@74
|
||||
|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|F|o@1| |{+0#e000e06&| +0#0000000&@60
|
||||
@2|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@62
|
||||
@2|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|B|a|r|"| +0#0000000&@62
|
||||
@2|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|B|a|z|"| +0#0000000&@62
|
||||
>}+0#e000e06&| +0#0000000&@73
|
||||
@75
|
||||
|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|-+0#e000e06&|a|d@1|r|=|a+0#00e0003&|r|g|u|m|e|n|t|s| +0#0000000&|-+0#e000e06&|b|a|n|g| +0#0000000&|-+0#e000e06&|b|a|r| +0#0000000&|-+0#e000e06&|b|u|f@1|e|r| +0#0000000&|-+0#e000e06&|c|o|m|p|l|e|t|e|=|a+0#00e0003&|r|g|l|i|s|t| +0#0000000&|-+0#e000e06&|c|o|u|n|t|=|1+0#e000002&| +0#0000000&|-+0#e000e06&|k|e@1
|
||||
|p|s|c|r|i|p|t| +0#0000000&|-+0#e000e06&|n|a|r|g|s|=|*+0#00e0003&| +0#0000000&|-+0#e000e06&|r|a|n|g|e|=|%+0#00e0003&| +0#0000000&|-+0#e000e06&|r|e|g|i|s|t|e|r| +0#0000000&|F|o@1| @35
|
||||
@6|\+0#e000e06&| +0#0000000&|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@56
|
||||
@75
|
||||
|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|-+0#e000e06&|c|o|m|p|l|e|t|e|=|c+0#00e0003&|u|s|t|o|m|,+0#0000000&|C|o|m|p|l|e|t|e|r|1| |F|o@1| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@23
|
||||
|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|-+0#e000e06&|c|o|m|p|l|e|t|e|=|c+0#00e0003&|u|s|t|o|m|l|i|s|t|,+0#0000000&|C|o|m|p|l|e|t|e|r|2| |F|o@1| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@19
|
||||
@75
|
||||
|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@60
|
||||
@2|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|F|o@1| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1| |(|d|e|f|i|n|e|d| |i|n| |:|f|u|n|c|t|i|o|n|)|"| +0#0000000&@26
|
||||
|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63
|
||||
@75
|
||||
|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|2|(+0#e000e06&|)| +0#0000000&@64
|
||||
@57|1|9|,|1| @9|2|3|%|
|
20
runtime/syntax/testdir/dumps/vim_ex_command_02.dump
Normal file
20
runtime/syntax/testdir/dumps/vim_ex_command_02.dump
Normal file
@@ -0,0 +1,20 @@
|
||||
|d+0#af5f00255#ffffff0|e|f| +0#0000000&|F|o@1|2|(+0#e000e06&|)| +0#0000000&@64
|
||||
@2|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|F|o@1| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1| |(|d|e|f|i|n|e|d| |i|n| |:|d|e|f|)|"| +0#0000000&@31
|
||||
|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
|
||||
@75
|
||||
|"+0#0000e05&| |m|u|l|t|i|l|i|n|e| |d|e|f|i|n|e| +0#0000000&@56
|
||||
> @74
|
||||
|"+0#0000e05&| |c|o|m@1|a|n|d|!| +0#0000000&@64
|
||||
|"+0#0000e05&| @6|\| |-|a|d@1|r|=|l|i|n|e|s| +0#0000000&@53
|
||||
|"+0#0000e05&| @6|\| |-|b|a|n|g| +0#0000000&@59
|
||||
|"+0#0000e05&| @6|\| |-|b|a|r| +0#0000000&@60
|
||||
|"+0#0000e05&| @6|\| |-|b|u|f@1|e|r| +0#0000000&@57
|
||||
|"+0#0000e05&| @6|\| |-|c|o|m|p|l|e|t|e|=|b|u|f@1|e|r| +0#0000000&@48
|
||||
|"+0#0000e05&| @6|\| |-|c|o|u|n|t| +0#0000000&@58
|
||||
|"+0#0000e05&| @6|\| |-|n|a|r|g|s|=|*| +0#0000000&@56
|
||||
|"+0#0000e05&| @6|\| |-|r|a|n|g|e| +0#0000000&@58
|
||||
|"+0#0000e05&| @6|\| |-|r|e|g|i|s|t|e|r| +0#0000000&@55
|
||||
|"+0#0000e05&| @6|\| |-|k|e@1|p|s|c|r|i|p|t| +0#0000000&@53
|
||||
|"+0#0000e05&| @6|\| |F|o@1| | +0#0000000&@60
|
||||
|"+0#0000e05&| @6|\| |e|c|h|o| |"+0#e000002&|F|O@1|"| +0#0000000&@54
|
||||
@57|3|6|,|0|-|1| @7|5|4|%|
|
20
runtime/syntax/testdir/dumps/vim_ex_command_03.dump
Normal file
20
runtime/syntax/testdir/dumps/vim_ex_command_03.dump
Normal file
@@ -0,0 +1,20 @@
|
||||
|"+0#0000e05#ffffff0| @6|\| |e|c|h|o| |"+0#e000002&|F|O@1|"| +0#0000000&@54
|
||||
@75
|
||||
|"+0#0000e05&| |e|r@1|o|r|s| +0#0000000&@66
|
||||
@75
|
||||
|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|-+0#ffffff16#ff404010|b|a|d|a|t@1|r|=+0#af5f00255#ffffff0|a+0#0000000&|r|g|u|m|e|n|t|s| |-+0#e000e06&|b|a|n|g| +0#0000000&|-+0#ffffff16#ff404010|b|a|d|a|t@1|r| +0#0000000#ffffff0|-+0#e000e06&|n|a|r|g|s|=|*+0#00e0003&| +0#0000000&|F|o@1| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@8
|
||||
> @74
|
||||
|"+0#0000e05&| |d|e|l|e|t|e| +0#0000000&@66
|
||||
@75
|
||||
|d+0#af5f00255&|e|l|c|o|m@1|a|n|d| +0#0000000&|F|o@1| @60
|
||||
|d+0#af5f00255&|e|l|c|o|m@1|a|n|d| +0#0000000&|-+0#e000e06&|b|u|f@1|e|r| +0#0000000&|F|o@1| @52
|
||||
@75
|
||||
|d+0#af5f00255&|e|l|c|o|m@1|a|n|d| +0#0000000&|F|o@1| ||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&@47
|
||||
|d+0#af5f00255&|e|l|c|o|m@1|a|n|d| +0#0000000&|-+0#e000e06&|b|u|f@1|e|r| +0#0000000&|F|o@1| ||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&@39
|
||||
@75
|
||||
|d+0#af5f00255&|e|l|c|o|m@1|a|n|d| +0#0000000&|F|o@1| |"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@50
|
||||
|d+0#af5f00255&|e|l|c|o|m@1|a|n|d| +0#0000000&|-+0#e000e06&|b|u|f@1|e|r| +0#0000000&|F|o@1| |"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@42
|
||||
@75
|
||||
|c+0#af5f00255&|o|m|c|l|e|a|r| +0#0000000&@66
|
||||
|c+0#af5f00255&|o|m|c|l|e|a|r| +0#0000000&|"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@56
|
||||
@57|5|4|,|0|-|1| @7|8|7|%|
|
20
runtime/syntax/testdir/dumps/vim_ex_command_04.dump
Normal file
20
runtime/syntax/testdir/dumps/vim_ex_command_04.dump
Normal file
@@ -0,0 +1,20 @@
|
||||
|c+0#af5f00255#ffffff0|o|m|c|l|e|a|r| +0#0000000&|"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@56
|
||||
|c+0#af5f00255&|o|m|c|l|e|a|r| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&@53
|
||||
@75
|
||||
@75
|
||||
|"+0#0000e05&| |I|s@1|u|e| |#|1|4|1|3|5| +0#0000000&@60
|
||||
> @74
|
||||
|c+0#af5f00255&|o|m| +0#0000000&|F|o@1| |c+0#af5f00255&|a|l@1| +0#0000000&|s+0#00e0e07&|y|s|t|e|m|(+0#0000000&|'+0#e000002&|l|s|'|)+0#0000000&| @49
|
||||
@75
|
||||
|~+0#4040ff13&| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
| +0#0000000&@56|7|2|,|0|-|1| @7|B|o|t|
|
@@ -1,5 +1,74 @@
|
||||
" Vim :command command
|
||||
" Vim :command, :delcommand and :comclear commands
|
||||
|
||||
|
||||
" list
|
||||
|
||||
command
|
||||
command F
|
||||
|
||||
" define
|
||||
|
||||
command Foo echo "Foo"
|
||||
command! Foo echo "Foo"
|
||||
command! Foo echo "Foo" | echo "Bar"
|
||||
|
||||
command! Foo {
|
||||
echo "Foo"
|
||||
echo "Bar"
|
||||
echo "Baz"
|
||||
}
|
||||
|
||||
command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register Foo
|
||||
\ echo "Foo"
|
||||
|
||||
command! -complete=custom,Completer1 Foo echo "Foo"
|
||||
command! -complete=customlist,Completer2 Foo echo "Foo"
|
||||
|
||||
function Foo()
|
||||
command! Foo echo "Foo (defined in :function)"
|
||||
endfunction
|
||||
|
||||
def Foo2()
|
||||
command! Foo echo "Foo (defined in :def)"
|
||||
enddef
|
||||
|
||||
" multiline define
|
||||
|
||||
" command!
|
||||
" \ -addr=lines
|
||||
" \ -bang
|
||||
" \ -bar
|
||||
" \ -buffer
|
||||
" \ -complete=buffer
|
||||
" \ -count
|
||||
" \ -nargs=*
|
||||
" \ -range
|
||||
" \ -register
|
||||
" \ -keepscript
|
||||
" \ Foo
|
||||
" \ echo "FOO"
|
||||
|
||||
" errors
|
||||
|
||||
command! -badattr=arguments -bang -badattr -nargs=* Foo echo "Foo"
|
||||
|
||||
" delete
|
||||
|
||||
delcommand Foo
|
||||
delcommand -buffer Foo
|
||||
|
||||
delcommand Foo | echo "..."
|
||||
delcommand -buffer Foo | echo "..."
|
||||
|
||||
delcommand Foo " comment
|
||||
delcommand -buffer Foo " comment
|
||||
|
||||
comclear
|
||||
comclear " comment
|
||||
comclear | echo "..."
|
||||
|
||||
|
||||
" Issue #14135
|
||||
|
||||
com Foo call system('ls')
|
||||
|
||||
|
Reference in New Issue
Block a user