mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -123,6 +123,30 @@ function! gitgutter#hunk#cursor_in_hunk(hunk) abort
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
|
||||
function! gitgutter#hunk#in_hunk(lnum)
|
||||
" Hunks are sorted in the order they appear in the buffer.
|
||||
for hunk in gitgutter#hunk#hunks(bufnr(''))
|
||||
" if in a hunk on first line of buffer
|
||||
if a:lnum == 1 && hunk[2] == 0
|
||||
return 1
|
||||
endif
|
||||
|
||||
" if in a hunk generally
|
||||
if a:lnum >= hunk[2] && a:lnum < hunk[2] + (hunk[3] == 0 ? 1 : hunk[3])
|
||||
return 1
|
||||
endif
|
||||
|
||||
" if hunk starts after the given line
|
||||
if a:lnum < hunk[2]
|
||||
return 0
|
||||
endif
|
||||
endfor
|
||||
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
|
||||
function! gitgutter#hunk#text_object(inner) abort
|
||||
let hunk = s:current_hunk()
|
||||
|
||||
|
Reference in New Issue
Block a user