mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-09 20:13:46 -05:00
Move hunk summary function to diff utility section.
This commit is contained in:
@@ -346,6 +346,24 @@ function! s:process_modified_and_removed(modifications, from_count, to_count, to
|
|||||||
call add(a:modifications, [a:to_line + offset - 1, 'modified_removed'])
|
call add(a:modifications, [a:to_line + offset - 1, 'modified_removed'])
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:update_hunk_summary(modified_lines)
|
||||||
|
let added = 0
|
||||||
|
let modified = 0
|
||||||
|
let removed = 0
|
||||||
|
for line in a:modified_lines
|
||||||
|
if match(line[1], 'added') > -1
|
||||||
|
let added += 1
|
||||||
|
endif
|
||||||
|
if match(line[1], 'modified') > -1
|
||||||
|
let modified += 1
|
||||||
|
endif
|
||||||
|
if match(line[1], 'removed') > -1
|
||||||
|
let removed += 1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
let s:hunk_summary = [added, modified, removed]
|
||||||
|
endfunction
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" Sign processing {{{
|
" Sign processing {{{
|
||||||
@@ -384,24 +402,6 @@ function! s:show_signs(file_name, modified_lines)
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:update_hunk_summary(modified_lines)
|
|
||||||
let added = 0
|
|
||||||
let modified = 0
|
|
||||||
let removed = 0
|
|
||||||
for line in a:modified_lines
|
|
||||||
if match(line[1], 'added') > -1
|
|
||||||
let added += 1
|
|
||||||
endif
|
|
||||||
if match(line[1], 'modified') > -1
|
|
||||||
let modified += 1
|
|
||||||
endif
|
|
||||||
if match(line[1], 'removed') > -1
|
|
||||||
let removed += 1
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
let s:hunk_summary = [added, modified, removed]
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:add_sign(line_number, name, file_name)
|
function! s:add_sign(line_number, name, file_name)
|
||||||
let id = s:next_sign_id()
|
let id = s:next_sign_id()
|
||||||
if !s:is_other_sign(a:line_number) " Don't clobber other people's signs.
|
if !s:is_other_sign(a:line_number) " Don't clobber other people's signs.
|
||||||
|
|||||||
Reference in New Issue
Block a user