mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-09 12:03:48 -05:00
@@ -25,8 +25,6 @@ function! gitgutter#process_buffer(bufnr, force) abort
|
|||||||
|
|
||||||
if gitgutter#utility#is_active(a:bufnr)
|
if gitgutter#utility#is_active(a:bufnr)
|
||||||
|
|
||||||
call s:setup_maps(a:bufnr)
|
|
||||||
|
|
||||||
if has('patch-7.4.1559')
|
if has('patch-7.4.1559')
|
||||||
let l:Callback = function('gitgutter#process_buffer', [a:bufnr, a:force])
|
let l:Callback = function('gitgutter#process_buffer', [a:bufnr, a:force])
|
||||||
else
|
else
|
||||||
@@ -108,12 +106,16 @@ endfunction
|
|||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
function! s:setup_maps(bufnr)
|
function! gitgutter#setup_maps()
|
||||||
if !g:gitgutter_map_keys
|
if !g:gitgutter_map_keys
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if gitgutter#utility#getbufvar(a:bufnr, 'mapped', 0)
|
" Note hasmapto() and maparg() operate on the current buffer.
|
||||||
|
|
||||||
|
let bufnr = bufnr('')
|
||||||
|
|
||||||
|
if gitgutter#utility#getbufvar(bufnr, 'mapped', 0)
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -147,7 +149,7 @@ function! s:setup_maps(bufnr)
|
|||||||
xmap <buffer> ac <Plug>GitGutterTextObjectOuterVisual
|
xmap <buffer> ac <Plug>GitGutterTextObjectOuterVisual
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call gitgutter#utility#setbufvar(a:bufnr, 'mapped', 1)
|
call gitgutter#utility#setbufvar(bufnr, 'mapped', 1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:setup_path(bufnr, continuation)
|
function! s:setup_path(bufnr, continuation)
|
||||||
|
|||||||
@@ -186,6 +186,8 @@ nnoremap <silent> <Plug>GitGutterPreviewHunk :GitGutterPreviewHunk<CR>
|
|||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
function! s:on_bufenter()
|
function! s:on_bufenter()
|
||||||
|
call gitgutter#setup_maps()
|
||||||
|
|
||||||
if exists('t:gitgutter_didtabenter') && t:gitgutter_didtabenter
|
if exists('t:gitgutter_didtabenter') && t:gitgutter_didtabenter
|
||||||
let t:gitgutter_didtabenter = 0
|
let t:gitgutter_didtabenter = 0
|
||||||
call gitgutter#all(!g:gitgutter_terminal_reports_focus)
|
call gitgutter#all(!g:gitgutter_terminal_reports_focus)
|
||||||
|
|||||||
Reference in New Issue
Block a user