patch 9.1.0945: ComplMatchIns highlight doesn't end after inserted text
Problem: ComplMatchIns highlight doesn't end after inserted text.
Solution: Handle ComplMatchIns highlight more like search highlight.
Fix off-by-one error. Handle deleting text properly.
(zeertzjq)
closes: #16244
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/insexpand.c b/src/insexpand.c
index fd82b36..2d14904 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -912,7 +912,7 @@
if (len == -1)
len = (int)STRLEN(p);
ins_bytes_len(p, len);
- compl_ins_end_col = curwin->w_cursor.col - 1;
+ compl_ins_end_col = curwin->w_cursor.col;
}
/*
@@ -2437,7 +2437,7 @@
int compl_len = get_compl_len();
if ((int)plen > compl_len)
- ins_compl_insert_bytes(p + compl_len, (int)(plen - compl_len));
+ ins_compl_insert_bytes(p + compl_len, (int)plen - compl_len);
}
retval = TRUE;
}
@@ -4264,6 +4264,7 @@
if (stop_arrow() == FAIL)
return;
backspace_until_column(col);
+ compl_ins_end_col = curwin->w_cursor.col;
}
// TODO: is this sufficient for redrawing? Redrawing everything causes