diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-07-31 21:32:31 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-07-31 21:32:31 +0200 |
commit | 620c959c6c00e469c4d3b1ab2e08e4767ee142a4 (patch) | |
tree | 9e366b7306b60f49c4fc2f37cb2236f915ff1df9 /src/indent.c | |
parent | 78db17c6f335f518752ca221ec6bde79db584e15 (diff) | |
download | vim-git-620c959c6c00e469c4d3b1ab2e08e4767ee142a4.tar.gz |
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.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/indent.c b/src/indent.c index 89653c777..99951c81b 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(); |