mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-08 11:33:47 -05:00
Compare commits
2 Commits
b5d1e1b3fe
...
blame_mess
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62c50ff296 | ||
|
|
c2877d0d5c |
@@ -298,6 +298,9 @@ endfunction
|
|||||||
function! s:repo_tree(...) dict abort
|
function! s:repo_tree(...) dict abort
|
||||||
if self.dir() =~# '/\.git$'
|
if self.dir() =~# '/\.git$'
|
||||||
let dir = self.dir()[0:-6]
|
let dir = self.dir()[0:-6]
|
||||||
|
if dir !~# '/'
|
||||||
|
let dir .= '/'
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
let dir = s:configured_tree(self.git_dir)
|
let dir = s:configured_tree(self.git_dir)
|
||||||
endif
|
endif
|
||||||
@@ -2049,6 +2052,7 @@ function! s:Blame(bang,line1,line2,count,args) abort
|
|||||||
if exists('+relativenumber')
|
if exists('+relativenumber')
|
||||||
setlocal norelativenumber
|
setlocal norelativenumber
|
||||||
endif
|
endif
|
||||||
|
let &l:statusline = '%{fugitive#blame_statusline('.bufnr('').')}%<'
|
||||||
execute "vertical resize ".(s:linechars('.\{-\}\ze\s\+\d\+)')+1)
|
execute "vertical resize ".(s:linechars('.\{-\}\ze\s\+\d\+)')+1)
|
||||||
nnoremap <buffer> <silent> <F1> :help fugitive-:Gblame<CR>
|
nnoremap <buffer> <silent> <F1> :help fugitive-:Gblame<CR>
|
||||||
nnoremap <buffer> <silent> g? :help fugitive-:Gblame<CR>
|
nnoremap <buffer> <silent> g? :help fugitive-:Gblame<CR>
|
||||||
@@ -2216,6 +2220,25 @@ function! s:RehighlightBlame() abort
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! fugitive#blame_statusline(nr) abort
|
||||||
|
if bufnr('%') != a:nr && !getwinvar(0, '&cursorbind')
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
let line = getbufline(a:nr, line('.'))[0]
|
||||||
|
let hash = matchstr(line, '^\^\=\zs\x\{7}')
|
||||||
|
if hash =~# '^0*$'
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
if type(getbufvar(a:nr, 'fugitive_blame_lookup')) != type({})
|
||||||
|
call setbufvar(a:nr, 'fugitive_blame_lookup', {})
|
||||||
|
endif
|
||||||
|
let lookup = getbufvar(a:nr, 'fugitive_blame_lookup')
|
||||||
|
if !has_key(lookup, hash)
|
||||||
|
let lookup[hash] = s:repo().git_chomp('log', '-1', hash, '--pretty=format:'.g:fugitive_summary_format)
|
||||||
|
endif
|
||||||
|
return get(lookup, hash, '')
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Section: Gbrowse
|
" Section: Gbrowse
|
||||||
|
|
||||||
call s:command("-bar -bang -range=0 -nargs=* -complete=customlist,s:EditComplete Gbrowse :execute s:Browse(<bang>0,<line1>,<count>,<f-args>)")
|
call s:command("-bar -bang -range=0 -nargs=* -complete=customlist,s:EditComplete Gbrowse :execute s:Browse(<bang>0,<line1>,<count>,<f-args>)")
|
||||||
|
|||||||
Reference in New Issue
Block a user