diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-11-30 11:47:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-30 11:47:30 +0800 |
commit | c0d17cec0b691488dbb3a57433e39d97aff36c47 (patch) | |
tree | ebd41705a12a0dbac92eda8d6f085417b3432390 /src/nvim/indent.c | |
parent | bfdddec8bab85340b4b293f1467a56f495e26c2f (diff) | |
download | rneovim-c0d17cec0b691488dbb3a57433e39d97aff36c47.tar.gz rneovim-c0d17cec0b691488dbb3a57433e39d97aff36c47.tar.bz2 rneovim-c0d17cec0b691488dbb3a57433e39d97aff36c47.zip |
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)
https://github.com/vim/vim/commit/620c959c6c00e469c4d3b1ab2e08e4767ee142a4
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/indent.c')
-rw-r--r-- | src/nvim/indent.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/indent.c b/src/nvim/indent.c index 0ffa152af7..bd91d1d4da 100644 --- a/src/nvim/indent.c +++ b/src/nvim/indent.c @@ -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(); |