diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-09 14:19:40 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-09 14:19:40 +0100 |
commit | 8f49e690dc7b6ed521fb11431e2a406d01c4de3a (patch) | |
tree | 34dee1c7ff7f87c750b3dc218b3492dacefefd9b /src/mouse.c | |
parent | 8ca29b6a3599b82b8822b7697cad63d0244c2d59 (diff) | |
download | vim-git-8f49e690dc7b6ed521fb11431e2a406d01c4de3a.tar.gz |
patch 9.0.0177: cursor position wrong with 'virtualedit' and mouse clickv9.0.0177
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)
Diffstat (limited to 'src/mouse.c')
-rw-r--r-- | src/mouse.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mouse.c b/src/mouse.c index 535e9a292..c126a9ed0 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -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 |