diff options
| author | raichoo <raichoo@googlemail.com> | 2017-03-11 10:46:50 +0100 |
|---|---|---|
| committer | raichoo <raichoo@googlemail.com> | 2017-03-19 21:14:11 +0100 |
| commit | ae828982ceb9dc4c5bde58a276e6e10df6f35051 (patch) | |
| tree | 7a5825075836640489dd37614f2f27b6c917cf30 /src/nvim/normal.c | |
| parent | 4500b16f15510f6091ca98b78aa4ee13e1acf2c7 (diff) | |
| download | rneovim-ae828982ceb9dc4c5bde58a276e6e10df6f35051.tar.gz rneovim-ae828982ceb9dc4c5bde58a276e6e10df6f35051.tar.bz2 rneovim-ae828982ceb9dc4c5bde58a276e6e10df6f35051.zip | |
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.
https://github.com/vim/vim/commit/c4a908e83690844b0d3a46124ba6af7d23485d69
Diffstat (limited to 'src/nvim/normal.c')
| -rw-r--r-- | src/nvim/normal.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 1fd03257ec..ce286042df 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -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); } |