aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2023-03-15 23:30:14 +0000
committerLewis Russell <lewis6991@gmail.com>2023-03-20 10:00:52 +0000
commite1db0e35e4d5859b96e6aff882df62d6c714b569 (patch)
tree8f6356c6a7cf6975c7bf26ad81fb3436ce1f90ae /src/nvim/ex_docmd.c
parent84027f7515b8ee6f818462f105882fc0052783c4 (diff)
downloadrneovim-e1db0e35e4d5859b96e6aff882df62d6c714b569.tar.gz
rneovim-e1db0e35e4d5859b96e6aff882df62d6c714b569.tar.bz2
rneovim-e1db0e35e4d5859b96e6aff882df62d6c714b569.zip
feat(api): add filetype option nvim_get_option_value
- Also adjust the expr-mapping behaviour so normal commands and text changes are allowed in internal dummy buffers.
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 061a8e699e..7b94e3184b 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -6326,6 +6326,11 @@ void restore_current_state(save_state_T *sst)
ui_cursor_shape(); // may show different cursor shape
}
+bool expr_map_locked(void)
+{
+ return expr_map_lock > 0 && !(curbuf->b_flags & BF_DUMMY);
+}
+
/// ":normal[!] {commands}": Execute normal mode commands.
static void ex_normal(exarg_T *eap)
{
@@ -6335,10 +6340,11 @@ static void ex_normal(exarg_T *eap)
}
char *arg = NULL;
- if (ex_normal_lock > 0) {
+ if (expr_map_locked()) {
emsg(_(e_secure));
return;
}
+
if (ex_normal_busy >= p_mmd) {
emsg(_("E192: Recursive use of :normal too deep"));
return;