mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Move function so code reads better.
This commit is contained in:
@@ -140,23 +140,6 @@ function! s:clear_signs()
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:show_signs(modified_lines)
|
|
||||||
let file_name = s:current_file()
|
|
||||||
for line in a:modified_lines
|
|
||||||
let line_number = line[0]
|
|
||||||
let type = line[1]
|
|
||||||
" TODO: eugh
|
|
||||||
if type ==? 'added'
|
|
||||||
let name = 'GitGutterLineAdded'
|
|
||||||
elseif type ==? 'removed'
|
|
||||||
let name = 'GitGutterLineRemoved'
|
|
||||||
elseif type ==? 'modified'
|
|
||||||
let name = 'GitGutterLineModified'
|
|
||||||
endif
|
|
||||||
call s:add_sign(line_number, name, file_name)
|
|
||||||
endfor
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" This assumes there are no GitGutter signs in the current file.
|
" This assumes there are no GitGutter signs in the current file.
|
||||||
" If this is untenable we could change the regexp to exclude GitGutter's
|
" If this is untenable we could change the regexp to exclude GitGutter's
|
||||||
" signs.
|
" signs.
|
||||||
@@ -174,6 +157,23 @@ function! s:find_other_signs()
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:show_signs(modified_lines)
|
||||||
|
let file_name = s:current_file()
|
||||||
|
for line in a:modified_lines
|
||||||
|
let line_number = line[0]
|
||||||
|
let type = line[1]
|
||||||
|
" TODO: eugh
|
||||||
|
if type ==? 'added'
|
||||||
|
let name = 'GitGutterLineAdded'
|
||||||
|
elseif type ==? 'removed'
|
||||||
|
let name = 'GitGutterLineRemoved'
|
||||||
|
elseif type ==? 'modified'
|
||||||
|
let name = 'GitGutterLineModified'
|
||||||
|
endif
|
||||||
|
call s:add_sign(line_number, name, file_name)
|
||||||
|
endfor
|
||||||
|
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