Skip to content

Commit 774e5a9

Browse files
committed
patch 8.0.0675: 'colorcolumn' has a higher priority than 'hlsearch'
Problem: 'colorcolumn' has a higher priority than 'hlsearch', it should be the other way around. (Nazri Ramliy) Solution: Change the priorities. (LemonBoy, closes #1794)
1 parent 5d7be4f commit 774e5a9

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

src/screen.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5502,7 +5502,8 @@ win_line(
55025502
* Also highlight the 'colorcolumn' if it is different than
55035503
* 'cursorcolumn' */
55045504
vcol_save_attr = -1;
5505-
if (draw_state == WL_LINE && !lnum_in_visual_area)
5505+
if (draw_state == WL_LINE && !lnum_in_visual_area
5506+
&& search_attr == 0 && area_attr == 0)
55065507
{
55075508
if (wp->w_p_cuc && VCOL_HLC == (long)wp->w_virtcol
55085509
&& lnum != wp->w_cursor.lnum)

src/testdir/test_listlbr_utf8.vim

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,21 @@ func Test_multibyte_sign_and_colorcolumn()
194194
call s:close_windows()
195195
endfunc
196196

197+
func Test_colorcolumn_priority()
198+
call s:test_windows('setl cc=4 cuc hls')
199+
call setline(1, ["xxyy", ""])
200+
norm! gg
201+
exe "normal! /xxyy\<CR>"
202+
norm! G
203+
redraw!
204+
let line_attr = s:screen_attr(1, [1, &cc])
205+
" Search wins over CursorColumn
206+
call assert_equal(line_attr[1], line_attr[0])
207+
" Search wins over Colorcolumn
208+
call assert_equal(line_attr[2], line_attr[3])
209+
call s:close_windows('setl hls&vim')
210+
endfunc
211+
197212
func Test_illegal_byte_and_breakat()
198213
call s:test_windows("setl sbr= brk+=<")
199214
vert resize 18

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
675,
767769
/**/
768770
674,
769771
/**/

0 commit comments

Comments
 (0)