summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-06-25 18:03:37 +0200
committerBram Moolenaar <Bram@vim.org>2017-06-25 18:03:37 +0200
commit774e5a9673260b1b8b88463669213a96637f72e8 (patch)
treeb3e401abdb0cff02762113cd029e5030d5efae66
parent5d7be4f0fa04a9210a14fca69b4f9e34613b378f (diff)
downloadvim-git-774e5a9673260b1b8b88463669213a96637f72e8.tar.gz
patch 8.0.0675: 'colorcolumn' has a higher priority than 'hlsearch'v8.0.0675
Problem: 'colorcolumn' has a higher priority than 'hlsearch', it should be the other way around. (Nazri Ramliy) Solution: Change the priorities. (LemonBoy, closes #1794)
-rw-r--r--src/screen.c3
-rw-r--r--src/testdir/test_listlbr_utf8.vim15
-rw-r--r--src/version.c2
3 files changed, 19 insertions, 1 deletions
diff --git a/src/screen.c b/src/screen.c
index 617051c95..3b281a894 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -5502,7 +5502,8 @@ win_line(
* Also highlight the 'colorcolumn' if it is different than
* 'cursorcolumn' */
vcol_save_attr = -1;
- if (draw_state == WL_LINE && !lnum_in_visual_area)
+ if (draw_state == WL_LINE && !lnum_in_visual_area
+ && search_attr == 0 && area_attr == 0)
{
if (wp->w_p_cuc && VCOL_HLC == (long)wp->w_virtcol
&& lnum != wp->w_cursor.lnum)
diff --git a/src/testdir/test_listlbr_utf8.vim b/src/testdir/test_listlbr_utf8.vim
index 56a4cc9b3..b648a3361 100644
--- a/src/testdir/test_listlbr_utf8.vim
+++ b/src/testdir/test_listlbr_utf8.vim
@@ -194,6 +194,21 @@ func Test_multibyte_sign_and_colorcolumn()
call s:close_windows()
endfunc
+func Test_colorcolumn_priority()
+ call s:test_windows('setl cc=4 cuc hls')
+ call setline(1, ["xxyy", ""])
+ norm! gg
+ exe "normal! /xxyy\<CR>"
+ norm! G
+ redraw!
+ let line_attr = s:screen_attr(1, [1, &cc])
+ " Search wins over CursorColumn
+ call assert_equal(line_attr[1], line_attr[0])
+ " Search wins over Colorcolumn
+ call assert_equal(line_attr[2], line_attr[3])
+ call s:close_windows('setl hls&vim')
+endfunc
+
func Test_illegal_byte_and_breakat()
call s:test_windows("setl sbr= brk+=<")
vert resize 18
diff --git a/src/version.c b/src/version.c
index fa4f6fb04..8dbd2a7d3 100644
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 675,
+/**/
674,
/**/
673,