aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_docmd.c2
-rw-r--r--src/nvim/getchar.c5
-rw-r--r--src/nvim/globals.h4
-rw-r--r--src/nvim/testdir/test_ex_mode.vim8
4 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index d4fe55392e..2899e17039 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -7899,9 +7899,11 @@ void do_exedit(exarg_T *eap, win_T *old_curwin)
need_wait_return = false;
msg_scroll = 0;
redraw_all_later(NOT_VALID);
+ pending_exmode_active = true;
normal_enter(false, true);
+ pending_exmode_active = false;
RedrawingDisabled = rd;
no_wait_return = nwr;
msg_scroll = ms;
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 0f6eddef9d..00372d4f3d 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -2475,6 +2475,11 @@ static int vgetorpeek(bool advance)
}
tc = c;
+ // return 0 in normal_check()
+ if (pending_exmode_active) {
+ exmode_active = true;
+ }
+
// no chars to block abbreviations for
typebuf.tb_no_abbr_cnt = 0;
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index 0281eebcee..01d4ab086e 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -636,6 +636,10 @@ EXTERN int motion_force INIT(=0); // motion force for pending operator
// Ex Mode (Q) state
EXTERN bool exmode_active INIT(= false); // true if Ex mode is active
+
+/// Flag set when normal_check() should return 0 when entering Ex mode.
+EXTERN bool pending_exmode_active INIT(= false);
+
EXTERN bool ex_no_reprint INIT(=false); // No need to print after z or p.
// 'inccommand' command preview state
diff --git a/src/nvim/testdir/test_ex_mode.vim b/src/nvim/testdir/test_ex_mode.vim
index c3f7fb45f4..68dda0868a 100644
--- a/src/nvim/testdir/test_ex_mode.vim
+++ b/src/nvim/testdir/test_ex_mode.vim
@@ -64,6 +64,14 @@ func Test_ex_mode()
let &encoding = encoding_save
endfunc
+func Test_Ex_feedkeys()
+ " this doesn't do anything useful, just check it doesn't hang
+ new
+ call setline(1, ["foo"])
+ call feedkeys("Qg/foo/visual\<CR>", "xt")
+ bwipe!
+endfunc
+
func Test_ex_mode_errors()
" Not allowed to enter ex mode when text is locked
au InsertCharPre <buffer> normal! gQ<CR>