mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-12 17:52:50 +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
|
function! s:self.len(sec) abort
|
||||||
let str = matchstr(a:sec, '%{.*}')
|
let str = matchstr(a:sec, '%{.*}')
|
||||||
if !empty(str)
|
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
|
else
|
||||||
return len(a:sec) + 4
|
return len(a:sec) + 4
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user