Avoid false positive matches of status files in non-status buffers

This commit is contained in:
Tim Pope
2018-07-22 01:58:20 -04:00
parent 4a5781bc1b
commit a8626a4ca4

View File

@@ -3078,8 +3078,8 @@ function! s:cfile() abort
let ref = matchstr(getline('.'),'\x\{40\}')
let file = ':'.s:sub(matchstr(getline('.'),'\d\t.*'),'\t',':')
return [file]
elseif getline('.') =~# '^.\=\trenamed:.* -> '
elseif &filetype ==# 'gitcommit'
if getline('.') =~# '^.\=\trenamed:.* -> '
let file = '/'.matchstr(getline('.'),' -> \zs.*')
return [file]
elseif getline('.') =~# '^.\=\t\(\k\| \)\+\p\?: *.'
@@ -3101,6 +3101,7 @@ function! s:cfile() abort
let file = matchstr(getline('.'),"'\\zs\\S\\+\\ze'")
return [file]
endif
endif
let showtree = (getline(1) =~# '^tree ' && getline(2) == "")