aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/indent.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-17 16:10:21 +0800
committerGitHub <noreply@github.com>2023-04-17 16:10:21 +0800
commit53985a6d31cc60d4b2d7a7af91929922de9ecf4d (patch)
tree001e142766b44da21d94b1ffc99d5230d7e6bee1 /src/nvim/indent.c
parent0dbb0419f47a76441d1e937d728033694c41cde7 (diff)
parent79a69337682ca0e3fc4d0bb9f70d851f8114bc9a (diff)
downloadrneovim-53985a6d31cc60d4b2d7a7af91929922de9ecf4d.tar.gz
rneovim-53985a6d31cc60d4b2d7a7af91929922de9ecf4d.tar.bz2
rneovim-53985a6d31cc60d4b2d7a7af91929922de9ecf4d.zip
Merge pull request #23148 from zeertzjq/vim-8.2.4179
vim-patch:8.2.{4179,4180,4181,4182,4183,4184,4185,4186,4193,4197}
Diffstat (limited to 'src/nvim/indent.c')
-rw-r--r--src/nvim/indent.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/indent.c b/src/nvim/indent.c
index 8a65e88545..1d8bceae4e 100644
--- a/src/nvim/indent.c
+++ b/src/nvim/indent.c
@@ -1122,6 +1122,7 @@ int get_expr_indent(void)
int save_set_curswant;
int save_State;
int use_sandbox = was_set_insecurely(curwin, "indentexpr", OPT_LOCAL);
+ const sctx_T save_sctx = current_sctx;
// Save and restore cursor position and curswant, in case it was changed
// * via :normal commands.
@@ -1134,6 +1135,7 @@ int get_expr_indent(void)
sandbox++;
}
textlock++;
+ current_sctx = curbuf->b_p_script_ctx[BV_INDE].script_ctx;
// Need to make a copy, the 'indentexpr' option could be changed while
// evaluating it.
@@ -1145,6 +1147,7 @@ int get_expr_indent(void)
sandbox--;
}
textlock--;
+ current_sctx = save_sctx;
// Restore the cursor position so that 'indentexpr' doesn't need to.
// Pretend to be in Insert mode, allow cursor past end of line for "o"