Mercurial > vim
diff src/normal.c @ 25921:203b0f3a741a v8.2.3494
patch 8.2.3494: illegal memory access in utf_head_off
Commit: https://github.com/vim/vim/commit/b07626d4afa73dd2af0f03c0d59eed25ee159ef9
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Oct 11 15:40:43 2021 +0100
patch 8.2.3494: illegal memory access in utf_head_off
Problem: Illegal memory access in utf_head_off.
Solution: Check cursor position when reselecting the Visual area.
(closes #8963)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 11 Oct 2021 16:45:04 +0200 |
parents | 16a7d1154be8 |
children | e8873138ffbb |
line wrap: on
line diff
--- a/src/normal.c +++ b/src/normal.c @@ -5671,8 +5671,7 @@ nv_visual(cmdarg_T *cap) { curwin->w_cursor.lnum += resel_VIsual_line_count * cap->count0 - 1; - if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count) - curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; + check_cursor(); } VIsual_mode = resel_VIsual_mode; if (VIsual_mode == 'v')