forked from aniani/vim
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)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user