diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/insexpand.c | 4 | ||||
-rw-r--r-- | src/nvim/move.c | 4 | ||||
-rw-r--r-- | src/nvim/normal.c | 7 |
3 files changed, 12 insertions, 3 deletions
diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index fe5faf8c10..7feb4f6661 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -2435,7 +2435,8 @@ static void expand_by_function(int type, char *base) } textlock--; - curwin->w_cursor = pos; // restore the cursor position + curwin->w_cursor = pos; // restore the cursor position + check_cursor(curwin); // make sure cursor position is valid, just in case validate_cursor(curwin); if (!equalpos(curwin->w_cursor, pos)) { emsg(_(e_compldel)); @@ -4059,6 +4060,7 @@ static int get_userdefined_compl_info(colnr_T curs_col) State = save_State; curwin->w_cursor = pos; // restore the cursor position + check_cursor(curwin); // make sure cursor position is valid, just in case validate_cursor(curwin); if (!equalpos(curwin->w_cursor, pos)) { emsg(_(e_compldel)); diff --git a/src/nvim/move.c b/src/nvim/move.c index 52b65c0fef..e7416549f5 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -196,7 +196,7 @@ static void redraw_for_cursorcolumn(win_T *wp) int sms_marker_overlap(win_T *wp, int extra2) { // There is no marker overlap when in showbreak mode, thus no need to - // account for it. See grid_put_linebuf(). + // account for it. See wlv_put_linebuf(). if (*get_showbreak_value(wp) != NUL) { return 0; } @@ -621,7 +621,7 @@ int cursor_valid(win_T *wp) // w_topline must be valid, you may need to call update_topline() first! void validate_cursor(win_T *wp) { - check_cursor(wp); + check_cursor_lnum(wp); check_cursor_moved(wp); if ((wp->w_valid & (VALID_WCOL|VALID_WROW)) != (VALID_WCOL|VALID_WROW)) { curs_columns(wp, true); diff --git a/src/nvim/normal.c b/src/nvim/normal.c index c7eb5c5793..2eb247a47e 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -32,6 +32,7 @@ #include "nvim/ex_cmds.h" #include "nvim/ex_cmds2.h" #include "nvim/ex_docmd.h" +#include "nvim/ex_eval.h" #include "nvim/ex_getln.h" #include "nvim/fileio.h" #include "nvim/fold.h" @@ -1403,6 +1404,12 @@ static int normal_check(VimState *state) normal_check_stuff_buffer(s); normal_check_interrupt(s); + // At the toplevel there is no exception handling. Discard any that + // may be hanging around (e.g. from "interrupt" at the debug prompt). + if (did_throw && !ex_normal_busy) { + discard_current_exception(); + } + if (!exmode_active) { msg_scroll = false; } |