Don't use "Head:" header for commit under cursor

This is the first line of the file so it's an annoyingly aggressive
default.
This commit is contained in:
Tim Pope
2020-03-05 13:20:33 -05:00
parent ffd7042c15
commit 12e43b62cc

View File

@@ -5824,7 +5824,7 @@ endfunction
" Section: Go to file
let s:ref_header = '\%(Head\|Merge\|Rebase\|Upstream\|Pull\|Push\)'
let s:ref_header = '\%(Merge\|Rebase\|Upstream\|Pull\|Push\)'
nnoremap <SID>: :<C-U><C-R>=v:count ? v:count : ''<CR>
function! fugitive#MapCfile(...) abort
@@ -6040,7 +6040,7 @@ function! s:StatusCfile(...) abort
return [lead . info.relative[0]]
elseif len(info.commit)
return [info.commit]
elseif line =~# '^' . s:ref_header . ': '
elseif line =~# '^' . s:ref_header . ': \|^Head: '
return [matchstr(line, ' \zs.*')]
else
return ['']