patch 9.0.0439: cursor wrong if inserting before line with virtual text above
Problem: Cursor wrong if inserting before line with virtual text above.
Solution: Add the width of the "above" virtual text to the cursor position.
(issue #11084)
diff --git a/src/charset.c b/src/charset.c
index acf6099..a19e55b 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1576,6 +1576,9 @@
if (((State & MODE_INSERT) == 0 || cts.cts_start_incl) && !on_NUL)
// cursor is after inserted text, unless on the NUL
vcol += cts.cts_cur_text_width;
+ else
+ // insertion also happens after the "above" virtual text
+ vcol += cts.cts_first_char;
#endif
*cursor = vcol + head; // cursor at start
}