vim-patch:8.2.4098: typing "interrupt" at debug prompt may keep exception around (#28161)

Problem:    Typing "interrupt" at debug prompt may keep exception around,
            causing function calls to fail.
Solution:   Discard any exception at the toplevel. (closes vim/vim#9532)

069613c9e8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq 2024-04-03 10:43:03 +08:00 committed by GitHub
parent 30b94ae494
commit 99b3a068de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

View File

@ -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;
}