[Maps] Fix parse error in non-US locales
Close #324 Caveat: The fix assumes that the paths of Vimscript files do not contain whitespaces. Maps will report incorrect paths if they do.
This commit is contained in:
parent
f3c3646c81
commit
8ffd3fb0ba
1 changed files with 4 additions and 5 deletions
|
@ -1094,13 +1094,12 @@ function! fzf#vim#maps(mode, ...)
|
||||||
let list = []
|
let list = []
|
||||||
let curr = ''
|
let curr = ''
|
||||||
for line in split(cout, "\n")
|
for line in split(cout, "\n")
|
||||||
let src = matchstr(line, 'Last set from \zs.*')
|
if line =~ "^\t"
|
||||||
if empty(src)
|
let src = ' '.join(reverse(reverse(split(split(line)[-1], '/'))[0:2]), '/')
|
||||||
let curr = line[3:]
|
|
||||||
else
|
|
||||||
let src = ' '.join(reverse(reverse(split(src, '/'))[0:2]), '/')
|
|
||||||
call add(list, printf('%s %s', curr, s:green(src, 'Comment')))
|
call add(list, printf('%s %s', curr, s:green(src, 'Comment')))
|
||||||
let curr = ''
|
let curr = ''
|
||||||
|
else
|
||||||
|
let curr = line[3:]
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
if !empty(curr)
|
if !empty(curr)
|
||||||
|
|
Loading…
Add table
Reference in a new issue