[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:
Junegunn Choi 2017-04-24 10:48:31 +09:00
parent f3c3646c81
commit 8ffd3fb0ba
No known key found for this signature in database
GPG key ID: 254BC280FEF9C627

View file

@ -1094,13 +1094,12 @@ function! fzf#vim#maps(mode, ...)
let list = []
let curr = ''
for line in split(cout, "\n")
let src = matchstr(line, 'Last set from \zs.*')
if empty(src)
let curr = line[3:]
else
let src = ' '.join(reverse(reverse(split(src, '/'))[0:2]), '/')
if line =~ "^\t"
let src = ' '.join(reverse(reverse(split(split(line)[-1], '/'))[0:2]), '/')
call add(list, printf('%s %s', curr, s:green(src, 'Comment')))
let curr = ''
else
let curr = line[3:]
endif
endfor
if !empty(curr)