comparison 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
comparison
equal deleted inserted replaced
25920:116d870cb436 25921:203b0f3a741a
5669 */ 5669 */
5670 if (resel_VIsual_mode != 'v' || resel_VIsual_line_count > 1) 5670 if (resel_VIsual_mode != 'v' || resel_VIsual_line_count > 1)
5671 { 5671 {
5672 curwin->w_cursor.lnum += 5672 curwin->w_cursor.lnum +=
5673 resel_VIsual_line_count * cap->count0 - 1; 5673 resel_VIsual_line_count * cap->count0 - 1;
5674 if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count) 5674 check_cursor();
5675 curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
5676 } 5675 }
5677 VIsual_mode = resel_VIsual_mode; 5676 VIsual_mode = resel_VIsual_mode;
5678 if (VIsual_mode == 'v') 5677 if (VIsual_mode == 'v')
5679 { 5678 {
5680 if (resel_VIsual_line_count <= 1) 5679 if (resel_VIsual_line_count <= 1)