mirror of
https://github.com/neovim/neovim.git
synced 2025-11-22 10:06:33 +00:00
vim-patch:7.4.1105
Problem: When using slices there is a mixup of variable name and namespace.
Solution: Recognize variables that can't be a namespace. (Hirohito Higashi)
9bbf63dbf8
This commit is contained in:
@@ -693,4 +693,22 @@ describe('eval', function()
|
||||
start:
|
||||
6]])
|
||||
end)
|
||||
|
||||
it('substring and variable name', function()
|
||||
execute("let str = 'abcdef'")
|
||||
execute('let n = 3')
|
||||
eq('def', eval('str[n:]'))
|
||||
eq('abcd', eval('str[:n]'))
|
||||
eq('d', eval('str[n:n]'))
|
||||
execute('unlet n')
|
||||
execute('let nn = 3')
|
||||
eq('def', eval('str[nn:]'))
|
||||
eq('abcd', eval('str[:nn]'))
|
||||
eq('d', eval('str[nn:nn]'))
|
||||
execute('unlet nn')
|
||||
execute('let b:nn = 4')
|
||||
eq('ef', eval('str[b:nn:]'))
|
||||
eq('abcde', eval('str[:b:nn]'))
|
||||
eq('e', eval('str[b:nn:b:nn]'))
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user