mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 23:31:51 +00:00
vim-patch:9.0.0205: cursor in wrong position when inserting after virtual text
Problem: Cursor in wrong position when inserting after virtual text. (Ben
Jackson)
Solution: Put the cursor after the virtual text, where the text will be
inserted. (closes vim/vim#10914)
28c9f89571
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -1092,7 +1092,7 @@ void getvcol(win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, colnr_T *en
|
||||
// cursor at end
|
||||
*cursor = vcol + incr - 1;
|
||||
} else {
|
||||
if ((State & MODE_INSERT) == 0 && !on_NUL) {
|
||||
if (((State & MODE_INSERT) == 0 || !cts.cts_has_right_gravity) && !on_NUL) {
|
||||
// cursor is after inserted text, unless on the NUL
|
||||
vcol += cts.cts_cur_text_width;
|
||||
}
|
||||
|
Reference in New Issue
Block a user