summaryrefslogtreecommitdiffstats
path: root/src/indent.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-07-31 21:32:31 +0200
committerBram Moolenaar <Bram@vim.org>2021-07-31 21:32:31 +0200
commit620c959c6c00e469c4d3b1ab2e08e4767ee142a4 (patch)
tree9e366b7306b60f49c4fc2f37cb2236f915ff1df9 /src/indent.c
parent78db17c6f335f518752ca221ec6bde79db584e15 (diff)
patch 8.2.3259: when 'indentexpr' causes an error did_throw may hangv8.2.3259
Problem: When 'indentexpr' causes an error the did_throw flag may remain set. Solution: Reset did_throw and show the error. (closes #8677)
Diffstat (limited to 'src/indent.c')
-rw-r--r--src/indent.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/indent.c b/src/indent.c
index 89653c7771..99951c81bf 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1822,6 +1822,13 @@ 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();