mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-09 12:03:48 -05:00
@@ -8,8 +8,8 @@ function! gitgutter#hunk#hunks() abort
|
|||||||
return s:hunks
|
return s:hunks
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! gitgutter#hunk#summary() abort
|
function! gitgutter#hunk#summary(bufnr) abort
|
||||||
return getbufvar(gitgutter#utility#bufnr(), 'gitgutter_summary', [0,0,0])
|
return getbufvar(a:bufnr, 'gitgutter_summary', [0,0,0])
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! gitgutter#hunk#reset() abort
|
function! gitgutter#hunk#reset() abort
|
||||||
@@ -17,21 +17,24 @@ function! gitgutter#hunk#reset() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! gitgutter#hunk#increment_lines_added(count) abort
|
function! gitgutter#hunk#increment_lines_added(count) abort
|
||||||
let summary = gitgutter#hunk#summary()
|
let bufnr = gitgutter#utility#bufnr()
|
||||||
|
let summary = gitgutter#hunk#summary(bufnr)
|
||||||
let summary[0] += a:count
|
let summary[0] += a:count
|
||||||
call setbufvar(gitgutter#utility#bufnr(), 'gitgutter_summary', summary)
|
call setbufvar(bufnr, 'gitgutter_summary', summary)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! gitgutter#hunk#increment_lines_modified(count) abort
|
function! gitgutter#hunk#increment_lines_modified(count) abort
|
||||||
let summary = gitgutter#hunk#summary()
|
let bufnr = gitgutter#utility#bufnr()
|
||||||
|
let summary = gitgutter#hunk#summary(bufnr)
|
||||||
let summary[1] += a:count
|
let summary[1] += a:count
|
||||||
call setbufvar(gitgutter#utility#bufnr(), 'gitgutter_summary', summary)
|
call setbufvar(bufnr, 'gitgutter_summary', summary)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! gitgutter#hunk#increment_lines_removed(count) abort
|
function! gitgutter#hunk#increment_lines_removed(count) abort
|
||||||
let summary = gitgutter#hunk#summary()
|
let bufnr = gitgutter#utility#bufnr()
|
||||||
|
let summary = gitgutter#hunk#summary(bufnr)
|
||||||
let summary[2] += a:count
|
let summary[2] += a:count
|
||||||
call setbufvar(gitgutter#utility#bufnr(), 'gitgutter_summary', summary)
|
call setbufvar(bufnr, 'gitgutter_summary', summary)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! gitgutter#hunk#next_hunk(count) abort
|
function! gitgutter#hunk#next_hunk(count) abort
|
||||||
|
|||||||
@@ -123,11 +123,11 @@ function! GitGutterGetHunks()
|
|||||||
return gitgutter#utility#is_active() ? gitgutter#hunk#hunks() : []
|
return gitgutter#utility#is_active() ? gitgutter#hunk#hunks() : []
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Returns an array that contains a summary of the current hunk status.
|
" Returns an array that contains a summary of the hunk status for the current
|
||||||
" The format is [ added, modified, removed ], where each value represents
|
" window. The format is [ added, modified, removed ], where each value
|
||||||
" the number of lines added/modified/removed respectively.
|
" represents the number of lines added/modified/removed respectively.
|
||||||
function! GitGutterGetHunkSummary()
|
function! GitGutterGetHunkSummary()
|
||||||
return gitgutter#hunk#summary()
|
return gitgutter#hunk#summary(winbufnr(0))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
|
|||||||
Reference in New Issue
Block a user