]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(vim): Update base-syntax, match bare mark ranges
authorDoug Kearns <dougkearns@gmail.com>
Sun, 22 Jun 2025 16:47:49 +0000 (18:47 +0200)
committerChristian Brabandt <cb@256bit.org>
Sun, 22 Jun 2025 16:47:49 +0000 (18:47 +0200)
Remove unmatchable :normal {mark,register} matches. The arg to :normal
is now handled separately and contained marks and registers are no
longer matched.

closes: #17571

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/syntax/generator/vim.vim.base
runtime/syntax/testdir/dumps/vim_ex_range_00.dump
runtime/syntax/testdir/dumps/vim_ex_range_01.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_range_02.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_range_03.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_range_04.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_range_05.dump [new file with mode: 0644]
runtime/syntax/testdir/input/vim_ex_range.vim
runtime/syntax/vim.vim

index fabf808e1175b8a783e4fc8c0d5c98a95558950b..a2ac5d2c874803b6b2bcdd44f100b69514f13aa5 100644 (file)
@@ -949,18 +949,17 @@ syn match vimMarkArgError contained       "["^.(){}0-9]"
 syn cluster    vimMarkArg      contains=vimMarkArg,vimMarkArgError
 
 " Marks, Registers, Addresses, Filters: {{{2
+syn match      vimMark "'[a-zA-Z0-9]\ze\s*$"
+syn match      vimMark "'[[\]{}()<>'`"^.]\ze\s*$"
 syn match      vimMark "'[a-zA-Z0-9]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
-syn match      vimMark "'[[\]{}()<>]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
-syn match      vimMark ",\zs'[[\]{}()<>]\ze"   nextgroup=vimFilter,vimMarkNumber,vimSubst1
+syn match      vimMark "'[[\]{}()<>'`"^.]\ze[-+,!]"    nextgroup=vimFilter,vimMarkNumber,vimSubst1
+syn match      vimMark ",\zs'[[\]{}()<>'`"^.]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
 syn match      vimMark "[!,:]\zs'[a-zA-Z0-9]"  nextgroup=vimFilter,vimMarkNumber,vimSubst1
-syn match      vimMark "\<norm\%[al]\s\zs'[a-zA-Z0-9]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
 syn match      vimMarkNumber   "[-+]\d\+"              contained contains=vimOper nextgroup=vimSubst1
 syn match      vimPlainMark contained  "'[a-zA-Z0-9]"
 syn match      vimRange        "[`'][a-zA-Z0-9],[`'][a-zA-Z0-9]"       contains=vimMark        skipwhite nextgroup=vimFilter
 
 syn match      vimRegister     '[^,;[{: \t]\zs"[a-zA-Z0-9.%#:_\-/]\ze[^a-zA-Z_":0-9]'
-syn match      vimRegister     '\<norm\s\+\zs"[a-zA-Z0-9]'
-syn match      vimRegister     '\<normal\s\+\zs"[a-zA-Z0-9]'
 syn match      vimRegister     '@"'
 syn match      vimPlainRegister contained      '"[a-zA-Z0-9\-:.%#*+=]'
 syn match      vimLetRegister  contained       '@["0-9\-a-zA-Z:.%#=*+~_/]'
index 2b0ad770e5685236297e9074836a9f83f46d0b01..ecc0c73c62c89029d398ad0d69766a4257f9a046 100644 (file)
@@ -1,20 +1,20 @@
 >"+0#0000e05#ffffff0| |E|x| |c|o|m@1|a|n|d| |r|a|n|g|e|s| +0#0000000&@55
 @75
+@75
 |'+0#e000002&|<|,+0#0000000&|'+0#e000002&|>|p+0#af5f00255&|r|i|n|t| +0#0000000&@64
 |'+0#e000002&|(|,+0#0000000&|'+0#e000002&|)|p+0#af5f00255&|r|i|n|t| +0#0000000&@64
 |'+0#e000002&|{|,+0#0000000&|'+0#e000002&|}|p+0#af5f00255&|r|i|n|t| +0#0000000&@64
 |'+0#e000002&|[|,+0#0000000&|'+0#e000002&|]|p+0#af5f00255&|r|i|n|t| +0#0000000&@64
-|~+0#4040ff13&| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-| +0#0000000&@56|1|,|1| @10|A|l@1| 
+@75
+|:|'+0#e000002&|<|,+0#0000000&|'+0#e000002&|>|p+0#af5f00255&|r|i|n|t| +0#0000000&@63
+|:|'+0#e000002&|(|,+0#0000000&|'+0#e000002&|)|p+0#af5f00255&|r|i|n|t| +0#0000000&@63
+|:|'+0#e000002&|{|,+0#0000000&|'+0#e000002&|}|p+0#af5f00255&|r|i|n|t| +0#0000000&@63
+|:|'+0#e000002&|[|,+0#0000000&|'+0#e000002&|]|p+0#af5f00255&|r|i|n|t| +0#0000000&@63
+@75
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|<|,+0#0000000&|'+0#e000002&|>|p+0#af5f00255&|r|i|n|t| +0#0000000&@57
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|(|,+0#0000000&|'+0#e000002&|)|p+0#af5f00255&|r|i|n|t| +0#0000000&@57
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|{|,+0#0000000&|'+0#e000002&|}|p+0#af5f00255&|r|i|n|t| +0#0000000&@57
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|[|,+0#0000000&|'+0#e000002&|]|p+0#af5f00255&|r|i|n|t| +0#0000000&@57
+@75
+|"+0#0000e05&| |b|a|r|e| |m|a|r|k| |r|a|n|g|e|s| +0#0000000&@56
+@57|1|,|1| @10|T|o|p| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_range_01.dump b/runtime/syntax/testdir/dumps/vim_ex_range_01.dump
new file mode 100644 (file)
index 0000000..7608528
--- /dev/null
@@ -0,0 +1,20 @@
+|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&||| |'+0#e000002&|<|,+0#0000000&|'+0#e000002&|>|p+0#af5f00255&|r|i|n|t| +0#0000000&@57
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|(|,+0#0000000&|'+0#e000002&|)|p+0#af5f00255&|r|i|n|t| +0#0000000&@57
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|{|,+0#0000000&|'+0#e000002&|}|p+0#af5f00255&|r|i|n|t| +0#0000000&@57
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|[|,+0#0000000&|'+0#e000002&|]|p+0#af5f00255&|r|i|n|t| +0#0000000&@57
+@75
+>"+0#0000e05&| |b|a|r|e| |m|a|r|k| |r|a|n|g|e|s| +0#0000000&@56
+@75
+|'+0#e000002&|a| +0#0000000&@72
+|'+0#e000002&|k| +0#0000000&@72
+|'+0#e000002&|z| +0#0000000&@72
+|'+0#e000002&|A| +0#0000000&@72
+|'+0#e000002&|K| +0#0000000&@72
+|'+0#e000002&|Z| +0#0000000&@72
+|'+0#e000002&|0| +0#0000000&@72
+|'+0#e000002&|9| +0#0000000&@72
+|'+0#e000002&|[| +0#0000000&@72
+|'+0#e000002&|]| +0#0000000&@72
+|'+0#e000002&|{| +0#0000000&@72
+|'+0#e000002&|}| +0#0000000&@72
+@57|1|9|,|1| @9|1|8|%| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_range_02.dump b/runtime/syntax/testdir/dumps/vim_ex_range_02.dump
new file mode 100644 (file)
index 0000000..acfcf54
--- /dev/null
@@ -0,0 +1,20 @@
+|'+0#e000002#ffffff0|}| +0#0000000&@72
+|'+0#e000002&|(| +0#0000000&@72
+|'+0#e000002&|)| +0#0000000&@72
+|'+0#e000002&|<| +0#0000000&@72
+|'+0#e000002&|>| +0#0000000&@72
+>'+0#e000002&|`| +0#0000000&@72
+|'+0#e000002&@1| +0#0000000&@72
+|'+0#e000002&|"| +0#0000000&@72
+|'+0#e000002&|^| +0#0000000&@72
+|'+0#e000002&|.| +0#0000000&@72
+@75
+@1|:|'+0#e000002&|a| +0#0000000&@70
+|:| |'+0#e000002&|a| +0#0000000&@70
+|:|'+0#e000002&|a| +0#0000000&@71
+|:|'+0#e000002&|k| +0#0000000&@71
+|:|'+0#e000002&|z| +0#0000000&@71
+|:|'+0#e000002&|A| +0#0000000&@71
+|:|'+0#e000002&|K| +0#0000000&@71
+|:|'+0#e000002&|Z| +0#0000000&@71
+@57|3|7|,|1| @9|4|3|%| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_range_03.dump b/runtime/syntax/testdir/dumps/vim_ex_range_03.dump
new file mode 100644 (file)
index 0000000..89477a9
--- /dev/null
@@ -0,0 +1,20 @@
+|:+0&#ffffff0|'+0#e000002&|Z| +0#0000000&@71
+|:|'+0#e000002&|0| +0#0000000&@71
+|:|'+0#e000002&|9| +0#0000000&@71
+|:|'+0#e000002&|[| +0#0000000&@71
+|:|'+0#e000002&|]| +0#0000000&@71
+>:|'+0#e000002&|{| +0#0000000&@71
+|:|'+0#e000002&|}| +0#0000000&@71
+|:|'+0#e000002&|(| +0#0000000&@71
+|:|'+0#e000002&|)| +0#0000000&@71
+|:|'+0#e000002&|<| +0#0000000&@71
+|:|'+0#e000002&|>| +0#0000000&@71
+|:|'+0#e000002&|`| +0#0000000&@71
+|:|'+0#e000002&@1| +0#0000000&@71
+|:|'+0#e000002&|"| +0#0000000&@71
+|:|'+0#e000002&|^| +0#0000000&@71
+|:|'+0#e000002&|.| +0#0000000&@71
+@75
+|e+0#af5f00255&|c|h|o| +0#0000000&|||'+0#e000002&|a| +0#0000000&@66
+|e+0#af5f00255&|c|h|o||+0#0000000&| |'+0#e000002&|a| +0#0000000&@66
+@57|5@1|,|1| @9|6|9|%| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_range_04.dump b/runtime/syntax/testdir/dumps/vim_ex_range_04.dump
new file mode 100644 (file)
index 0000000..d9869fe
--- /dev/null
@@ -0,0 +1,20 @@
+|e+0#af5f00255#ffffff0|c|h|o||+0#0000000&| |'+0#e000002&|a| +0#0000000&@66
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|a| +0#0000000&@65
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|k| +0#0000000&@65
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|z| +0#0000000&@65
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|A| +0#0000000&@65
+>e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|K| +0#0000000&@65
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|Z| +0#0000000&@65
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|0| +0#0000000&@65
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|9| +0#0000000&@65
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|[| +0#0000000&@65
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|]| +0#0000000&@65
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|{| +0#0000000&@65
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|}| +0#0000000&@65
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|(| +0#0000000&@65
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|)| +0#0000000&@65
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|<| +0#0000000&@65
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|>| +0#0000000&@65
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|`| +0#0000000&@65
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&@1| +0#0000000&@65
+@57|7|3|,|1| @9|9|4|%| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_range_05.dump b/runtime/syntax/testdir/dumps/vim_ex_range_05.dump
new file mode 100644 (file)
index 0000000..cadd7bb
--- /dev/null
@@ -0,0 +1,20 @@
+|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&||| |'+0#e000002&@1| +0#0000000&@65
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|"| +0#0000000&@65
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|^| +0#0000000&@65
+|e+0#af5f00255&|c|h|o| +0#0000000&||| |'+0#e000002&|.| +0#0000000&@65
+> @74
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|9|0|,|0|-|1| @7|B|o|t| 
index 3383702c2c7798f60c253fec425a657ac2726b69..88e7ad47150f57e4e49b34dd625f279f85800a7b 100644 (file)
@@ -1,6 +1,90 @@
 " Ex command ranges
 
+
 '<,'>print
 '(,')print
 '{,'}print
 '[,']print
+
+:'<,'>print
+:'(,')print
+:'{,'}print
+:'[,']print
+
+echo | '<,'>print
+echo | '(,')print
+echo | '{,'}print
+echo | '[,']print
+
+" bare mark ranges
+
+'a
+'k
+'z
+'A
+'K
+'Z
+'0
+'9
+'[
+']
+'{
+'}
+'(
+')
+'<
+'>
+'`
+''
+'"
+'^
+'.
+
+ :'a
+: 'a
+:'a
+:'k
+:'z
+:'A
+:'K
+:'Z
+:'0
+:'9
+:'[
+:']
+:'{
+:'}
+:'(
+:')
+:'<
+:'>
+:'`
+:''
+:'"
+:'^
+:'.
+
+echo |'a
+echo| 'a
+echo | 'a
+echo | 'k
+echo | 'z
+echo | 'A
+echo | 'K
+echo | 'Z
+echo | '0
+echo | '9
+echo | '[
+echo | ']
+echo | '{
+echo | '}
+echo | '(
+echo | ')
+echo | '<
+echo | '>
+echo | '`
+echo | ''
+echo | '"
+echo | '^
+echo | '.
+
index 71d7f37ef63046c29f0a1fe1c1008c4c4e95a62b..0021b7433a93fc43f6f581199e5990ba461251f1 100644 (file)
@@ -1004,18 +1004,17 @@ syn match       vimMarkArgError contained       "["^.(){}0-9]"
 syn cluster    vimMarkArg      contains=vimMarkArg,vimMarkArgError
 
 " Marks, Registers, Addresses, Filters: {{{2
+syn match      vimMark "'[a-zA-Z0-9]\ze\s*$"
+syn match      vimMark "'[[\]{}()<>'`"^.]\ze\s*$"
 syn match      vimMark "'[a-zA-Z0-9]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
-syn match      vimMark "'[[\]{}()<>]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
-syn match      vimMark ",\zs'[[\]{}()<>]\ze"   nextgroup=vimFilter,vimMarkNumber,vimSubst1
+syn match      vimMark "'[[\]{}()<>'`"^.]\ze[-+,!]"    nextgroup=vimFilter,vimMarkNumber,vimSubst1
+syn match      vimMark ",\zs'[[\]{}()<>'`"^.]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
 syn match      vimMark "[!,:]\zs'[a-zA-Z0-9]"  nextgroup=vimFilter,vimMarkNumber,vimSubst1
-syn match      vimMark "\<norm\%[al]\s\zs'[a-zA-Z0-9]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
 syn match      vimMarkNumber   "[-+]\d\+"              contained contains=vimOper nextgroup=vimSubst1
 syn match      vimPlainMark contained  "'[a-zA-Z0-9]"
 syn match      vimRange        "[`'][a-zA-Z0-9],[`'][a-zA-Z0-9]"       contains=vimMark        skipwhite nextgroup=vimFilter
 
 syn match      vimRegister     '[^,;[{: \t]\zs"[a-zA-Z0-9.%#:_\-/]\ze[^a-zA-Z_":0-9]'
-syn match      vimRegister     '\<norm\s\+\zs"[a-zA-Z0-9]'
-syn match      vimRegister     '\<normal\s\+\zs"[a-zA-Z0-9]'
 syn match      vimRegister     '@"'
 syn match      vimPlainRegister contained      '"[a-zA-Z0-9\-:.%#*+=]'
 syn match      vimLetRegister  contained       '@["0-9\-a-zA-Z:.%#=*+~_/]'