Show error on :Gblame jump on uncommitted line

This commit is contained in:
Tim Pope
2018-07-25 00:17:12 -04:00
parent 07d30de8be
commit fbaa831e57

View File

@@ -2341,12 +2341,16 @@ function! s:Blame(bang,line1,line2,count,args) abort
endfunction endfunction
function! s:BlameCommit(cmd) abort function! s:BlameCommit(cmd) abort
let cmd = s:Edit(a:cmd, 0, '', matchstr(getline('.'),'\x\+')) let line = getline('.')
if line =~# '^0\{4,40\} '
return 'echoerr ' . string('Not Committed Yet')
endif
let cmd = s:Edit(a:cmd, 0, '', matchstr(line, '\x\+'))
if cmd =~# '^echoerr' if cmd =~# '^echoerr'
return cmd return cmd
endif endif
let lnum = matchstr(getline('.'),' \zs\d\+\ze\s\+[([:digit:]]') let lnum = matchstr(line, ' \zs\d\+\ze\s\+[([:digit:]]')
let path = matchstr(getline('.'),'^\^\=\x\+\s\+\zs.\{-\}\ze\s*\d\+ ') let path = matchstr(line, '^\^\=\x\+\s\+\zs.\{-\}\ze\s*\d\+ ')
if path ==# '' if path ==# ''
let path = fugitive#Path(bufname(b:fugitive_blamed_bufnr), '') let path = fugitive#Path(bufname(b:fugitive_blamed_bufnr), '')
endif endif