summaryrefslogtreecommitdiffstats
path: root/src/charset.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-09-10 22:32:14 +0100
committerBram Moolenaar <Bram@vim.org>2022-09-10 22:32:14 +0100
commit88b79cb7d47e2e1fee1baf4016c50b861e6b21c4 (patch)
tree7d17b0fa0635124fca3ff7bbe986452142f630d9 /src/charset.c
parent04e0ed1ddf399d609dbcb7dbf19e531da1fe6172 (diff)
patch 9.0.0439: cursor wrong if inserting before line with virtual text abovev9.0.0439
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)
Diffstat (limited to 'src/charset.c')
-rw-r--r--src/charset.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/charset.c b/src/charset.c
index acf60999db..a19e55b628 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1576,6 +1576,9 @@ getvcol(
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
}