mirror of
https://github.com/neovim/neovim.git
synced 2025-09-12 22:38:16 +00:00
vim-patch:8.2.3259 when 'indentexpr' causes an error did_throw may hang (#21240)
vim-patch:8.2.3259: when 'indentexpr' causes an error did_throw may hang
Problem: When 'indentexpr' causes an error the did_throw flag may remain
set.
Solution: Reset did_throw and show the error. (closes vim/vim#8677)
620c959c6c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/typval_defs.h"
|
||||
#include "nvim/ex_docmd.h"
|
||||
#include "nvim/extmark.h"
|
||||
#include "nvim/gettext.h"
|
||||
#include "nvim/globals.h"
|
||||
@@ -1153,6 +1154,12 @@ int get_expr_indent(void)
|
||||
check_cursor();
|
||||
State = save_State;
|
||||
|
||||
// Reset did_throw, unless 'debug' has "throw" and inside a try/catch.
|
||||
if (did_throw && (vim_strchr(p_debug, 't') == NULL || trylevel == 0)) {
|
||||
handle_did_throw();
|
||||
did_throw = false;
|
||||
}
|
||||
|
||||
// If there is an error, just keep the current indent.
|
||||
if (indent < 0) {
|
||||
indent = get_indent();
|
||||
|
Reference in New Issue
Block a user