1
0
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:
Reed 2021-02-02 05:58:16 -06:00 committed by GitHub
parent a279122e0c
commit 6ce4e0e6fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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