From 8ffd3fb0bae52825afe977eb27447ddc94d8ae7c Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 24 Apr 2017 10:48:31 +0900 Subject: [PATCH] [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. --- autoload/fzf/vim.vim | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/autoload/fzf/vim.vim b/autoload/fzf/vim.vim index 9185198..3bd9711 100644 --- a/autoload/fzf/vim.vim +++ b/autoload/fzf/vim.vim @@ -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)