s:cfile: Match multi-byte characters #806 (#810)

For some locales like de_DE.UTF8 the text of `git status` contains multi-byte characters.
This change allows a subsequent file name to be matched correctly .
This commit is contained in:
canaaerus
2016-06-22 20:46:54 +01:00
committed by Tim Pope
parent 3439f999b1
commit 4865891565

View File

@@ -2840,7 +2840,7 @@ function! s:cfile() abort
elseif getline('.') =~# '^#\trenamed:.* -> ' elseif getline('.') =~# '^#\trenamed:.* -> '
let file = '/'.matchstr(getline('.'),' -> \zs.*') let file = '/'.matchstr(getline('.'),' -> \zs.*')
return [file] return [file]
elseif getline('.') =~# '^#\t[[:alpha:] ]\+: *.' elseif getline('.') =~# '^#\t\(\k\| \)\+: *.'
let file = '/'.matchstr(getline('.'),': *\zs.\{-\}\ze\%( ([^()[:digit:]]\+)\)\=$') let file = '/'.matchstr(getline('.'),': *\zs.\{-\}\ze\%( ([^()[:digit:]]\+)\)\=$')
return [file] return [file]
elseif getline('.') =~# '^#\t.' elseif getline('.') =~# '^#\t.'