diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-24 13:01:30 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-24 13:13:00 -0400 |
commit | 529d88c64164f69e8005192f75e392640c941b9f (patch) | |
tree | 7003d8dae6ce0e94dc1ef4aa2b2aaac868be0cf0 /src | |
parent | db3136d2eac607514ca76a6e4defc33dedd1539d (diff) | |
download | rneovim-529d88c64164f69e8005192f75e392640c941b9f.tar.gz rneovim-529d88c64164f69e8005192f75e392640c941b9f.tar.bz2 rneovim-529d88c64164f69e8005192f75e392640c941b9f.zip |
vim-patch:8.2.1689: 'colorcolumn' doesn't show in indent
Problem: 'colorcolumn' doesn't show in indent.
Solution: Also draw the column when draw_state is WL_BRI or WL_SBR.
(Alexey Demin, closes vim/vim#6948, closes vim/vim#6619)
https://github.com/vim/vim/commit/ad5e5631c5dc93a50bbe637be254c5e9968848ea
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/screen.c | 6 | ||||
-rw-r--r-- | src/nvim/testdir/test_highlight.vim | 36 |
2 files changed, 41 insertions, 1 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index c40211bcb6..90ac4ac7aa 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -4138,8 +4138,12 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, // highlight the cursor position itself. // Also highlight the 'colorcolumn' if it is different than // 'cursorcolumn' + // Also highlight the 'colorcolumn' if 'breakindent' and/or 'showbreak' + // options are set vcol_save_attr = -1; - if (draw_state == WL_LINE + if ((draw_state == WL_LINE + || draw_state == WL_BRI + || draw_state == WL_SBR) && !lnum_in_visual_area && search_attr == 0 && area_attr == 0 diff --git a/src/nvim/testdir/test_highlight.vim b/src/nvim/testdir/test_highlight.vim index ce22de09ca..24c9c3580e 100644 --- a/src/nvim/testdir/test_highlight.vim +++ b/src/nvim/testdir/test_highlight.vim @@ -595,6 +595,42 @@ func Test_cursorline_with_visualmode() call delete('Xtest_cursorline_with_visualmode') endfunc +func Test_colorcolumn_bri() + CheckScreendump + + " check 'colorcolumn' when 'breakindent' is set + let lines =<< trim END + call setline(1, 'The quick brown fox jumped over the lazy dogs') + END + call writefile(lines, 'Xtest_colorcolumn_bri') + let buf = RunVimInTerminal('-S Xtest_colorcolumn_bri', {'rows': 10,'columns': 40}) + call term_sendkeys(buf, ":set co=40 linebreak bri briopt=shift:2 cc=40,41,43\<CR>") + call TermWait(buf) + call VerifyScreenDump(buf, 'Test_colorcolumn_2', {}) + + " clean up + call StopVimInTerminal(buf) + call delete('Xtest_colorcolumn_bri') +endfunc + +func Test_colorcolumn_sbr() + CheckScreendump + + " check 'colorcolumn' when 'showbreak' is set + let lines =<< trim END + call setline(1, 'The quick brown fox jumped over the lazy dogs') + END + call writefile(lines, 'Xtest_colorcolumn_srb') + let buf = RunVimInTerminal('-S Xtest_colorcolumn_srb', {'rows': 10,'columns': 40}) + call term_sendkeys(buf, ":set co=40 showbreak=+++>\\ cc=40,41,43\<CR>") + call TermWait(buf) + call VerifyScreenDump(buf, 'Test_colorcolumn_3', {}) + + " clean up + call StopVimInTerminal(buf) + call delete('Xtest_colorcolumn_srb') +endfunc + " This test must come before the Test_cursorline test, as it appears this " defines the Normal highlighting group anyway. func Test_1_highlight_Normalgroup_exists() |