mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-12-08 13:04:51 +08:00
Avoid false positive matches of status files in non-status buffers
This commit is contained in:
@@ -3078,8 +3078,8 @@ function! s:cfile() abort
|
|||||||
let ref = matchstr(getline('.'),'\x\{40\}')
|
let ref = matchstr(getline('.'),'\x\{40\}')
|
||||||
let file = ':'.s:sub(matchstr(getline('.'),'\d\t.*'),'\t',':')
|
let file = ':'.s:sub(matchstr(getline('.'),'\d\t.*'),'\t',':')
|
||||||
return [file]
|
return [file]
|
||||||
|
elseif &filetype ==# 'gitcommit'
|
||||||
elseif getline('.') =~# '^.\=\trenamed:.* -> '
|
if getline('.') =~# '^.\=\trenamed:.* -> '
|
||||||
let file = '/'.matchstr(getline('.'),' -> \zs.*')
|
let file = '/'.matchstr(getline('.'),' -> \zs.*')
|
||||||
return [file]
|
return [file]
|
||||||
elseif getline('.') =~# '^.\=\t\(\k\| \)\+\p\?: *.'
|
elseif getline('.') =~# '^.\=\t\(\k\| \)\+\p\?: *.'
|
||||||
@@ -3101,6 +3101,7 @@ function! s:cfile() abort
|
|||||||
let file = matchstr(getline('.'),"'\\zs\\S\\+\\ze'")
|
let file = matchstr(getline('.'),"'\\zs\\S\\+\\ze'")
|
||||||
return [file]
|
return [file]
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
let showtree = (getline(1) =~# '^tree ' && getline(2) == "")
|
let showtree = (getline(1) =~# '^tree ' && getline(2) == "")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user