summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-09-15 20:52:26 +0200
committerBram Moolenaar <Bram@vim.org>2020-09-15 20:52:26 +0200
commitad5e5631c5dc93a50bbe637be254c5e9968848ea (patch)
tree1e45c995ab1ef7772891db27cccf65dc26232a2a /src
parentc8f12c9856df58c760fe54d81b2ec5ed4dcaffd6 (diff)
downloadvim-git-ad5e5631c5dc93a50bbe637be254c5e9968848ea.tar.gz
patch 8.2.1689: 'colorcolumn' doesn't show in indentv8.2.1689
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)
Diffstat (limited to 'src')
-rw-r--r--src/drawline.c6
-rw-r--r--src/testdir/dumps/Test_colorcolumn_2.dump10
-rw-r--r--src/testdir/dumps/Test_colorcolumn_3.dump10
-rw-r--r--src/testdir/test_highlight.vim36
-rw-r--r--src/version.c2
5 files changed, 63 insertions, 1 deletions
diff --git a/src/drawline.c b/src/drawline.c
index 2b72de648..82738f13c 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -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
diff --git a/src/testdir/dumps/Test_colorcolumn_2.dump b/src/testdir/dumps/Test_colorcolumn_2.dump
new file mode 100644
index 000000000..44e0e7a2d
--- /dev/null
+++ b/src/testdir/dumps/Test_colorcolumn_2.dump
@@ -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|
diff --git a/src/testdir/dumps/Test_colorcolumn_3.dump b/src/testdir/dumps/Test_colorcolumn_3.dump
new file mode 100644
index 000000000..6cb0c241c
--- /dev/null
+++ b/src/testdir/dumps/Test_colorcolumn_3.dump
@@ -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|
diff --git a/src/testdir/test_highlight.vim b/src/testdir/test_highlight.vim
index b5e382f1a..4f2e238e4 100644
--- a/src/testdir/test_highlight.vim
+++ b/src/testdir/test_highlight.vim
@@ -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()
diff --git a/src/version.c b/src/version.c
index 23006e1ed..f4b02418e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1689,
+/**/
1688,
/**/
1687,