summaryrefslogtreecommitdiff
path: root/src/match.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-11-29 19:18:57 +0000
committerBram Moolenaar <Bram@vim.org>2021-11-29 19:18:57 +0000
commit0c359af5c0fd106d3f57cc0bb7cef1c89b5e1e10 (patch)
tree81e741e604559a6f4d2ade79da6dfa5a602840b3 /src/match.c
parent0b74d00693f2ff5f45cb5808197df7d1aaa5cb41 (diff)
downloadvim-git-0c359af5c0fd106d3f57cc0bb7cef1c89b5e1e10.tar.gz
patch 8.2.3698: match highlighting continues over breakindentv8.2.3698
Problem: Match highlighting continues over breakindent. Solution: Stop before the end column. (closes #9242)
Diffstat (limited to 'src/match.c')
-rw-r--r--src/match.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/match.c b/src/match.c
index b5762fca2..40f426ec6 100644
--- a/src/match.c
+++ b/src/match.c
@@ -703,6 +703,8 @@ prepare_search_hl_line(
* 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
@@ -715,7 +717,8 @@ update_search_hl(
int *has_match_conc UNUSED,
int *match_conc UNUSED,
int did_line_attr,
- int lcs_eol_one)
+ int lcs_eol_one,
+ int *on_last_col)
{
matchitem_T *cur; // points to the match list
match_T *shl; // points to search_hl or a match
@@ -832,7 +835,10 @@ update_search_hl(
else
shl = &cur->hl;
if (shl->attr_cur != 0)
+ {
search_attr = shl->attr_cur;
+ *on_last_col = col + 1 >= shl->endcol;
+ }
if (shl != search_hl && cur != NULL)
cur = cur->next;
}