diff --git a/plugin/gitgutter.vim b/plugin/gitgutter.vim index 98d53ac..d4a08a9 100644 --- a/plugin/gitgutter.vim +++ b/plugin/gitgutter.vim @@ -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']) 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 {{{ @@ -384,24 +402,6 @@ function! s:show_signs(file_name, modified_lines) endfor 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) let id = s:next_sign_id() if !s:is_other_sign(a:line_number) " Don't clobber other people's signs.