0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 9.0.0177: cursor position wrong with 'virtualedit' and mouse click

Problem:    Cursor position wrong with 'virtualedit' and mouse click after end
            of the line. (Hermann Mayer)
Solution:   Do not use ScreenCols[] when 'virtualedit' is active.
            (closes #10868)
This commit is contained in:
Bram Moolenaar
2022-08-09 14:19:40 +01:00
parent 8ca29b6a35
commit 8f49e690dc
3 changed files with 39 additions and 1 deletions

View File

@@ -1967,7 +1967,8 @@ retnomove:
// Only use ScreenCols[] after the window was redrawn. Mainly matters
// for tests, a user would not click before redrawing.
if (curwin->w_redr_type <= VALID_NO_UPDATE)
// Do not use when 'virtualedit' is active.
if (curwin->w_redr_type <= VALID_NO_UPDATE && !virtual_active())
col_from_screen = ScreenCols[off];
#ifdef FEAT_FOLDING
// Remember the character under the mouse, it might be a '-' or '+' in