diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-11-24 18:37:52 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-11-24 18:52:27 +0800 |
commit | 81c87857f632d1afe147e9b77a97da38f8f3a887 (patch) | |
tree | b9fbaa4fbc0bc9f8b89249574ccc92da2ec97552 /src/nvim/match.c | |
parent | 868d8d69627c4b8fd5225da0dff5905f75645946 (diff) | |
download | rneovim-81c87857f632d1afe147e9b77a97da38f8f3a887.tar.gz rneovim-81c87857f632d1afe147e9b77a97da38f8f3a887.tar.bz2 rneovim-81c87857f632d1afe147e9b77a97da38f8f3a887.zip |
vim-patch:8.2.3698: match highlighting continues over breakindent
Problem: Match highlighting continues over breakindent.
Solution: Stop before the end column. (closes vim/vim#9242)
https://github.com/vim/vim/commit/0c359af5c0fd106d3f57cc0bb7cef1c89b5e1e10
Cherry-pick Test_matchdelete_redraw() from patch 8.2.1077.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/match.c')
-rw-r--r-- | src/nvim/match.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/match.c b/src/nvim/match.c index fc98ad8396..c38c4e7daf 100644 --- a/src/nvim/match.c +++ b/src/nvim/match.c @@ -677,9 +677,11 @@ bool prepare_search_hl_line(win_T *wp, linenr_T lnum, colnr_T mincol, char_u **l /// After end, check for start/end of next match. /// When another match, have to check for start again. /// Watch out for matching an empty string! +/// "on_last_col" is set to true with non-zero search_attr and the next column +/// is endcol. /// Return the updated search_attr. int update_search_hl(win_T *wp, linenr_T lnum, colnr_T col, char_u **line, match_T *search_hl, - int *has_match_conc, int *match_conc, int lcs_eol_one, + int *has_match_conc, int *match_conc, int lcs_eol_one, bool *on_last_col, bool *search_attr_from_match) { matchitem_T *cur = wp->w_match_head; // points to the match list @@ -792,6 +794,7 @@ int update_search_hl(win_T *wp, linenr_T lnum, colnr_T col, char_u **line, match } if (shl->attr_cur != 0) { search_attr = shl->attr_cur; + *on_last_col = col + 1 >= shl->endcol; *search_attr_from_match = shl != search_hl; } if (shl != search_hl && cur != NULL) { |