mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-11 08:55:43 +08:00
fix (layer): Remove error when file name contains curly brace (#4065)
eval() in the len() function now evals from the 3rd character to the character before the first right hand curly brace Regarding issue #3976
This commit is contained in:
parent
a279122e0c
commit
6ce4e0e6fe
@ -25,7 +25,8 @@ let s:self.__bufnr = -1
|
||||
function! s:self.len(sec) abort
|
||||
let str = matchstr(a:sec, '%{.*}')
|
||||
if !empty(str)
|
||||
return len(a:sec) - len(str) + len(eval(str[2:-2])) + 4
|
||||
let pos = match(str, '}')
|
||||
return len(a:sec) - len(str) + len(eval(str[2:pos-1])) + 4
|
||||
else
|
||||
return len(a:sec) + 4
|
||||
endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user