bufhl: use extmark column adjustment for bufhl

NB: this is not the final implementation. Bufhl should be made a
part of the extmark tree, so that "start" adjustment just works
automatically. But "stop" will still need some ad-hoc trickery,
until extended marks natively support ranges (hopefully sooner than
forever).
This commit is contained in:
Björn Linse
2018-06-29 13:35:42 +02:00
parent d5f14b8372
commit bdebe8516c
4 changed files with 241 additions and 1 deletions

View File

@@ -5599,9 +5599,10 @@ insertchar (
do_digraph(-1); /* clear digraphs */
do_digraph(buf[i-1]); /* may be the start of a digraph */
buf[i] = NUL;
colnr_T col_start = curwin->w_cursor.col;
ins_str(buf);
extmark_col_adjust(curbuf, curwin->w_cursor.lnum,
(colnr_T)(curwin->w_cursor.col + 1), 0,
(colnr_T)(col_start + 1), 0,
(long)STRLEN(buf), kExtmarkUndo);
if (flags & INSCHAR_CTRLV) {
redo_literal(*buf);