diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-07-14 13:32:51 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-06 21:56:38 -0400 |
commit | a920ae89e958d1ae912b127cdbedfb90ed4c3ed4 (patch) | |
tree | 42cdc0a61b8d94c7ad68744d9c9514ee24eb55c5 /src/nvim/screen.c | |
parent | 593c0bd77f4d38fd73d6de024a4e41738a2f20d4 (diff) | |
download | rneovim-a920ae89e958d1ae912b127cdbedfb90ed4c3ed4.tar.gz rneovim-a920ae89e958d1ae912b127cdbedfb90ed4c3ed4.tar.bz2 rneovim-a920ae89e958d1ae912b127cdbedfb90ed4c3ed4.zip |
vim-patch:8.0.1168: wrong highlighting with combination of match and 'cursorline'
Problem: wrong highlighting with combination of match and 'cursorline'.
Solution: Use "line_attr" when appropriate. (Ozaki Kiichi, closes vim/vim#2111)
But don't highlight more than one character.
https://github.com/vim/vim/commit/0aa398f55a327282c70f56e0bac2dcb9521da378
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r-- | src/nvim/screen.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 8e7a84c6b1..256a3ed4b5 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -2197,7 +2197,7 @@ win_line ( match_T *shl; // points to search_hl or a match int shl_flag; // flag to indicate whether search_hl // has been processed or not - int prevcol_hl_flag; // flag to indicate whether prevcol + bool prevcol_hl_flag; // flag to indicate whether prevcol // equals startcol of search_hl or one // of the matches int prev_c = 0; // previous Arabic character @@ -3026,6 +3026,10 @@ win_line ( if (shl != &search_hl && cur != NULL) cur = cur->next; } + // Only highlight one character after the last column. + if (*ptr == NUL && did_line_attr >= 1) { + search_attr = 0; + } } if (diff_hlf != (hlf_T)0) { @@ -3674,7 +3678,9 @@ win_line ( // don't do search HL for the rest of the line if ((line_attr_lowprio || line_attr) - && char_attr == search_attr && col > 0) { + && char_attr == search_attr + && (did_line_attr > 1 + || (wp->w_p_list && lcs_eol > 0))) { char_attr = line_attr; } if (diff_hlf == HLF_TXD) { @@ -3833,9 +3839,12 @@ win_line ( || lnum == VIsual.lnum || lnum == curwin->w_cursor.lnum) && c == NUL) - /* highlight 'hlsearch' match at end of line */ - || (prevcol_hl_flag == TRUE && did_line_attr <= 1) - )) { + // highlight 'hlsearch' match at end of line + || (prevcol_hl_flag + && !(wp->w_p_cul && lnum == wp->w_cursor.lnum + && !(wp == curwin && VIsual_active)) + && diff_hlf == (hlf_T)0 + && did_line_attr <= 1))) { int n = 0; if (wp->w_p_rl) { |