vim-patch:7.4.2347

Problem:    Crash when closing a buffer while Visual mode is active.
            (Dominique Pelle)
Solution:   Adjust the position before computing the number of lines.
            When closing the current buffer stop Visual mode.

c4a908e836
This commit is contained in:
raichoo
2017-03-11 10:46:50 +01:00
parent 4500b16f15
commit ae828982ce
4 changed files with 29 additions and 2 deletions

View File

@@ -1596,6 +1596,8 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank)
oap->start = curwin->w_cursor;
}
// Just in case lines were deleted that make the position invalid.
check_pos(curwin->w_buffer, &oap->end);
oap->line_count = oap->end.lnum - oap->start.lnum + 1;
/* Set "virtual_op" before resetting VIsual_active. */
@@ -7831,7 +7833,6 @@ static void get_op_vcol(
// prevent from moving onto a trail byte
if (has_mbyte) {
check_pos(curwin->w_buffer, &oap->end);
mb_adjustpos(curwin->w_buffer, &oap->end);
}