From e9dd640897e6a318d770be62bbcc9f417f95990e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 16 Aug 2021 15:27:04 +0800 Subject: vim-patch:8.2.3295: 'cursorline' should not apply to 'breakindent' #15281 Problem: 'cursorline' should not apply to 'breakindent'. Solution: Make 'cursorline' apply to 'breakindent' and 'showbreak' consistently. (closes vim/vim#8684) https://github.com/vim/vim/commit/4f33bc20d7d5444e44d13f954e8219ad1abd26ef --- src/nvim/testdir/test_cursorline.vim | 22 ++++++++++++++++++++++ src/nvim/testdir/test_diffmode.vim | 31 +++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_cursorline.vim b/src/nvim/testdir/test_cursorline.vim index 4a0f2665fe..39d8b901ed 100644 --- a/src/nvim/testdir/test_cursorline.vim +++ b/src/nvim/testdir/test_cursorline.vim @@ -192,7 +192,29 @@ func Test_cursorline_screenline() call term_sendkeys(buf, "gj") call term_wait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_18', {}) + call term_sendkeys(buf, ":set breakindent& foldcolumn& signcolumn&\") endif + " showbreak should not be highlighted with CursorLine when 'number' is off + call term_sendkeys(buf, "gg0") + call term_sendkeys(buf, ":set list cursorlineopt=screenline listchars=space:-\") + call term_sendkeys(buf, ":set nonumber\") + call VerifyScreenDump(buf, 'Test_'. filename. '_19', {}) + call term_sendkeys(buf, "fagj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_20', {}) + call term_sendkeys(buf, "gj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_21', {}) + call term_sendkeys(buf, "gj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_22', {}) + call term_sendkeys(buf, "gj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_23', {}) + call term_sendkeys(buf, "gj") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_'. filename. '_24', {}) + call term_sendkeys(buf, ":set list& cursorlineopt& listchars&\") call StopVimInTerminal(buf) call delete(filename) diff --git a/src/nvim/testdir/test_diffmode.vim b/src/nvim/testdir/test_diffmode.vim index 8592f48af7..5c9c1ce884 100644 --- a/src/nvim/testdir/test_diffmode.vim +++ b/src/nvim/testdir/test_diffmode.vim @@ -990,6 +990,37 @@ func Test_diff_with_cursorline() call delete('Xtest_diff_cursorline') endfunc +func Test_diff_with_cursorline_breakindent() + CheckScreendump + + call writefile([ + \ 'hi CursorLine ctermbg=red ctermfg=white', + \ 'set noequalalways wrap diffopt=followwrap cursorline breakindent', + \ '50vnew', + \ 'call setline(1, [" "," "," "," "])', + \ 'exe "norm 20Afoo\j20Afoo\j20Afoo\j20Abar\"', + \ 'vnew', + \ 'call setline(1, [" "," "," "," "])', + \ 'exe "norm 20Abee\j20Afoo\j20Afoo\j20Abaz\"', + \ 'windo diffthis', + \ '2wincmd w', + \ ], 'Xtest_diff_cursorline_breakindent') + let buf = RunVimInTerminal('-S Xtest_diff_cursorline_breakindent', {}) + + call term_sendkeys(buf, "gg0") + call VerifyScreenDump(buf, 'Test_diff_with_cul_bri_01', {}) + call term_sendkeys(buf, "j") + call VerifyScreenDump(buf, 'Test_diff_with_cul_bri_02', {}) + call term_sendkeys(buf, "j") + call VerifyScreenDump(buf, 'Test_diff_with_cul_bri_03', {}) + call term_sendkeys(buf, "j") + call VerifyScreenDump(buf, 'Test_diff_with_cul_bri_04', {}) + + " clean up + call StopVimInTerminal(buf) + call delete('Xtest_diff_cursorline_breakindent') +endfunc + func Test_diff_with_syntax() CheckScreendump -- cgit