Merge branch 'ext-signs'

This commit is contained in:
Marco Hinz 2013-06-24 11:27:53 +02:00
commit 32f70cac6d
3 changed files with 42 additions and 21 deletions

View File

@ -68,23 +68,26 @@ Sign explanation
A new line was added. The sign is shown on the same line as the new line. A new line was added. The sign is shown on the same line as the new line.
`_` `_1`
A line was deleted. The sign is shown on the line above the deleted line. Special case: The first line was deleted. In this case the sign is shown on the same line. A line was deleted. The sign is shown on the line above the deleted line. The
second character indicates the number of deleted lines: 1-9, and # for
everything above.
`!` `!`
A line was changed. Something was changed, but the amount of lines stayed the same. The sign is shown on the same line. A line was changed. Something was changed, but the amount of lines stayed the
same. The sign is shown on the same line.
`!_` `!_`
A line was changed and one or more of the lines below were deleted. A combination of **!** and **_**. The sign is shown on the same line. A line was changed and one or more of the lines below were deleted. A
combination of **!** and **_**. The sign is shown on the same line.
`‾` `‾`
The first line was deleted. This special case is indicated by **‾** rather than This is used instead of _ in the special case of the first line being removed.
**_**.
Longer introduction Longer introduction
------------------- -------------------

View File

@ -66,11 +66,11 @@ Sign explanation:
A new line was added. The sign is shown on the same line as the new line. A new line was added. The sign is shown on the same line as the new line.
_ _1
A line was deleted. The sign is shown on the line above the deleted line. A line was deleted. The sign is shown on the line above the deleted line. The
Special case: The first line was deleted. In this case the sign is shown on second character indicates the number of deleted lines: 1-9, and # for
the same line. everything above.
! !

View File

@ -347,7 +347,7 @@ function! s:repo_process_diff(path, diff) abort
if new_line == 0 if new_line == 0
call s:sign_set(1, 'SignifyDeleteFirstLine', a:path) call s:sign_set(1, 'SignifyDeleteFirstLine', a:path)
else else
call s:sign_set(new_line, 'SignifyDelete', a:path) call s:sign_set(new_line, (old_count > 9) ? 'SignifyDeleteMore' : 'SignifyDelete'. old_count, a:path)
endif endif
" A line was changed. " A line was changed.
elseif (old_count == new_count) elseif (old_count == new_count)
@ -474,8 +474,17 @@ endfunction
function! s:line_highlighting_enable() abort function! s:line_highlighting_enable() abort
execute 'sign define SignifyAdd text='. s:sign_add .' texthl=SignifyAdd linehl='. s:line_color_add execute 'sign define SignifyAdd text='. s:sign_add .' texthl=SignifyAdd linehl='. s:line_color_add
execute 'sign define SignifyChange text='. s:sign_change .' texthl=SignifyChange linehl='. s:line_color_change execute 'sign define SignifyChange text='. s:sign_change .' texthl=SignifyChange linehl='. s:line_color_change
execute 'sign define SignifyChangeDelete text='. s:sign_change_delete .' texthl=SignifyChange linehl='. s:line_color_change_delete execute 'sign define SignifyChangeDelete text='. s:sign_change_delete .' texthl=SignifyChange linehl='. s:line_color_change
execute 'sign define SignifyDelete text='. s:sign_delete .' texthl=SignifyDelete linehl='. s:line_color_delete execute 'sign define SignifyDelete1 text='. s:sign_delete .'1 texthl=SignifyDelete linehl='. s:line_color_delete
execute 'sign define SignifyDelete2 text='. s:sign_delete .'2 texthl=SignifyDelete linehl='. s:line_color_delete
execute 'sign define SignifyDelete3 text='. s:sign_delete .'3 texthl=SignifyDelete linehl='. s:line_color_delete
execute 'sign define SignifyDelete4 text='. s:sign_delete .'4 texthl=SignifyDelete linehl='. s:line_color_delete
execute 'sign define SignifyDelete5 text='. s:sign_delete .'5 texthl=SignifyDelete linehl='. s:line_color_delete
execute 'sign define SignifyDelete6 text='. s:sign_delete .'6 texthl=SignifyDelete linehl='. s:line_color_delete
execute 'sign define SignifyDelete7 text='. s:sign_delete .'7 texthl=SignifyDelete linehl='. s:line_color_delete
execute 'sign define SignifyDelete8 text='. s:sign_delete .'8 texthl=SignifyDelete linehl='. s:line_color_delete
execute 'sign define SignifyDelete9 text='. s:sign_delete .'9 texthl=SignifyDelete linehl='. s:line_color_delete
execute 'sign define SignifyDeleteMore text='. s:sign_delete .'# texthl=SignifyDelete linehl='. s:line_color_delete
execute 'sign define SignifyDeleteFirstLine text='. s:sign_delete_first_line .' texthl=SignifyDelete linehl='. s:line_color_delete execute 'sign define SignifyDeleteFirstLine text='. s:sign_delete_first_line .' texthl=SignifyDelete linehl='. s:line_color_delete
let s:line_highlight = 1 let s:line_highlight = 1
@ -483,11 +492,20 @@ endfunction
" Function: s:line_highlighting_disable {{{1 " Function: s:line_highlighting_disable {{{1
function! s:line_highlighting_disable() abort function! s:line_highlighting_disable() abort
execute 'sign define SignifyAdd text='. s:sign_add .' texthl=SignifyAdd linehl=NONE' execute 'sign define SignifyAdd text='. s:sign_add .' texthl=SignifyAdd linehl=none'
execute 'sign define SignifyChange text='. s:sign_change .' texthl=SignifyChange linehl=NONE' execute 'sign define SignifyChange text='. s:sign_change .' texthl=SignifyChange linehl=none'
execute 'sign define SignifyChangeDelete text='. s:sign_change_delete .' texthl=SignifyChange linehl=NONE' execute 'sign define SignifyChangeDelete text='. s:sign_change_delete .' texthl=SignifyChange linehl=none'
execute 'sign define SignifyDelete text='. s:sign_delete .' texthl=SignifyDelete linehl=NONE' execute 'sign define SignifyDelete1 text='. s:sign_delete .'1 texthl=SignifyDelete linehl=none'
execute 'sign define SignifyDeleteFirstLine text='. s:sign_delete_first_line .' texthl=SignifyDelete linehl=NONE' execute 'sign define SignifyDelete2 text='. s:sign_delete .'2 texthl=SignifyDelete linehl=none'
execute 'sign define SignifyDelete3 text='. s:sign_delete .'3 texthl=SignifyDelete linehl=none'
execute 'sign define SignifyDelete4 text='. s:sign_delete .'4 texthl=SignifyDelete linehl=none'
execute 'sign define SignifyDelete5 text='. s:sign_delete .'5 texthl=SignifyDelete linehl=none'
execute 'sign define SignifyDelete6 text='. s:sign_delete .'6 texthl=SignifyDelete linehl=none'
execute 'sign define SignifyDelete7 text='. s:sign_delete .'7 texthl=SignifyDelete linehl=none'
execute 'sign define SignifyDelete8 text='. s:sign_delete .'8 texthl=SignifyDelete linehl=none'
execute 'sign define SignifyDelete9 text='. s:sign_delete .'9 texthl=SignifyDelete linehl=none'
execute 'sign define SignifyDeleteMore text='. s:sign_delete .'# texthl=SignifyDelete linehl=none'
execute 'sign define SignifyDeleteFirstLine text='. s:sign_delete_first_line .' texthl=SignifyDelete linehl=none'
let s:line_highlight = 0 let s:line_highlight = 0
endfunction endfunction