mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
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 #6948, closes #6619)
This commit is contained in:
@@ -2775,8 +2775,12 @@ win_line(
|
||||
// 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 && !lnum_in_visual_area
|
||||
if ((draw_state == WL_LINE ||
|
||||
draw_state == WL_BRI ||
|
||||
draw_state == WL_SBR) && !lnum_in_visual_area
|
||||
&& search_attr == 0 && area_attr == 0)
|
||||
{
|
||||
if (wp->w_p_cuc && VCOL_HLC == (long)wp->w_virtcol
|
||||
|
10
src/testdir/dumps/Test_colorcolumn_2.dump
Normal file
10
src/testdir/dumps/Test_colorcolumn_2.dump
Normal file
@@ -0,0 +1,10 @@
|
||||
>T+0&#ffffff0|h|e| |q|u|i|c|k| |b|r|o|w|n| |f|o|x| |j|u|m|p|e|d| |o|v|e|r| |t|h|e| @3| +0&#ffd7d7255
|
||||
@1| +0&#ffffff0|l+0&#ffd7d7255|a+0&#ffffff0|z|y| |d|o|g|s| @28
|
||||
|~+0#4040ff13&| @38
|
||||
|~| @38
|
||||
|~| @38
|
||||
|~| @38
|
||||
|~| @38
|
||||
|~| @38
|
||||
|~| @38
|
||||
| +0#0000000&@21|1|,|1| @10|A|l@1|
|
10
src/testdir/dumps/Test_colorcolumn_3.dump
Normal file
10
src/testdir/dumps/Test_colorcolumn_3.dump
Normal file
@@ -0,0 +1,10 @@
|
||||
>T+0&#ffffff0|h|e| |q|u|i|c|k| |b|r|o|w|n| |f|o|x| |j|u|m|p|e|d| |o|v|e|r| |t|h|e| |l|a|z|y+0&#ffd7d7255
|
||||
|++0#4040ff13&|++0&#ffffff0|++0&#ffd7d7255|>+0&#ffffff0| | +0#0000000&|d|o|g|s| @29
|
||||
|~+0#4040ff13&| @38
|
||||
|~| @38
|
||||
|~| @38
|
||||
|~| @38
|
||||
|~| @38
|
||||
|~| @38
|
||||
|~| @38
|
||||
| +0#0000000&@21|1|,|1| @10|A|l@1|
|
@@ -662,6 +662,42 @@ func Test_colorcolumn()
|
||||
call delete('Xtest_colorcolumn')
|
||||
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()
|
||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1689,
|
||||
/**/
|
||||
1688,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user