runtime(vim): Update base syntax, fix Vim9 :for loop variable highlighting
Highlight the iteration variable's type in Vim9 :for {var} loops.
Reported by Aliaksei Budavei.
fixes: #17961
closes: #18163
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
68f681c6ab
commit
6f97624e11
@ -65,3 +65,24 @@ for [foo: number, bar: number] in expr2
|
||||
echo foo bar
|
||||
endfor
|
||||
|
||||
|
||||
# Issue #7961 (Builtin types are not highlighted in item-variable declarations
|
||||
# of :for commands)
|
||||
|
||||
var m: number
|
||||
var n: number
|
||||
for x: number in range(2) | m = x | endfor
|
||||
###### ^^^^^^
|
||||
echo m
|
||||
for [x: number, y: number] in [[0, 0], [1, 1]] | [m, n] = [x, y] | endfor
|
||||
echo m n
|
||||
|
||||
var F: func
|
||||
for t: tuple<func> in ((function('tolower'),),) | F = t[0] | endfor
|
||||
###### ^^^^^^^^^^^
|
||||
echo F('HELLO')
|
||||
for [L: func, U: func] in [[function('tolower'), function('toupper')]]
|
||||
[_, F] = [L, U]
|
||||
endfor
|
||||
echo F('hello') F('world')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user