mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
vim-patch:8.2.1957: diff and cursorcolumn highlighting don't mix
Problem: Diff and cursorcolumn highlighting don't mix.
Solution: Fix condition for what attribute to use. (Christian Brabandt,
closes vim/vim#7258, closes vim/vim#7260)
fabc3ca896
This commit is contained in:
@@ -4139,8 +4139,11 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow,
|
|||||||
// Also highlight the 'colorcolumn' if it is different than
|
// Also highlight the 'colorcolumn' if it is different than
|
||||||
// 'cursorcolumn'
|
// 'cursorcolumn'
|
||||||
vcol_save_attr = -1;
|
vcol_save_attr = -1;
|
||||||
if (draw_state == WL_LINE && !lnum_in_visual_area
|
if (draw_state == WL_LINE
|
||||||
&& search_attr == 0 && area_attr == 0) {
|
&& !lnum_in_visual_area
|
||||||
|
&& search_attr == 0
|
||||||
|
&& area_attr == 0
|
||||||
|
&& filler_todo <= 0) {
|
||||||
if (wp->w_p_cuc && VCOL_HLC == (long)wp->w_virtcol
|
if (wp->w_p_cuc && VCOL_HLC == (long)wp->w_virtcol
|
||||||
&& lnum != wp->w_cursor.lnum) {
|
&& lnum != wp->w_cursor.lnum) {
|
||||||
vcol_save_attr = char_attr;
|
vcol_save_attr = char_attr;
|
||||||
|
@@ -1148,5 +1148,38 @@ func Test_diff_and_scroll()
|
|||||||
set ls&
|
set ls&
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_diff_filler_cursorcolumn()
|
||||||
|
CheckScreendump
|
||||||
|
|
||||||
|
let content =<< trim END
|
||||||
|
call setline(1, ['aa', 'bb', 'cc'])
|
||||||
|
vnew
|
||||||
|
call setline(1, ['aa', 'cc'])
|
||||||
|
windo diffthis
|
||||||
|
wincmd p
|
||||||
|
setlocal cursorcolumn foldcolumn=0
|
||||||
|
norm! gg0
|
||||||
|
redraw!
|
||||||
|
END
|
||||||
|
call writefile(content, 'Xtest_diff_cuc')
|
||||||
|
let buf = RunVimInTerminal('-S Xtest_diff_cuc', {})
|
||||||
|
|
||||||
|
call VerifyScreenDump(buf, 'Test_diff_cuc_01', {})
|
||||||
|
|
||||||
|
call term_sendkeys(buf, "l")
|
||||||
|
call term_sendkeys(buf, "\<C-l>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_diff_cuc_02', {})
|
||||||
|
call term_sendkeys(buf, "0j")
|
||||||
|
call term_sendkeys(buf, "\<C-l>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_diff_cuc_03', {})
|
||||||
|
call term_sendkeys(buf, "l")
|
||||||
|
call term_sendkeys(buf, "\<C-l>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_diff_cuc_04', {})
|
||||||
|
|
||||||
|
" clean up
|
||||||
|
call StopVimInTerminal(buf)
|
||||||
|
call delete('Xtest_diff_cuc')
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
Reference in New Issue
Block a user