Move hunk summary function to diff utility section.

This commit is contained in:
Andy Stewart
2013-08-19 17:55:46 +02:00
parent bdaff53497
commit e07e6aa601

View File

@@ -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.