diff options
-rw-r--r-- | src/errors.h | 4 | ||||
-rw-r--r-- | src/normal.c | 5 | ||||
-rw-r--r-- | src/testdir/test_cmdwin.vim | 9 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 20 insertions, 0 deletions
diff --git a/src/errors.h b/src/errors.h index 90aa2921a6..965187f785 100644 --- a/src/errors.h +++ b/src/errors.h @@ -3306,3 +3306,7 @@ EXTERN char e_substitute_nesting_too_deep[] EXTERN char e_invalid_argument_nr[] INIT(= N_("E1291: Invalid argument: %ld")); #endif +#ifdef FEAT_CMDWIN +EXTERN char e_cmdline_window_already_open[] + INIT(= N_("E1292: Command-line window is already open")); +#endif diff --git a/src/normal.c b/src/normal.c index 72ebcd5386..932d723205 100644 --- a/src/normal.c +++ b/src/normal.c @@ -7147,6 +7147,11 @@ nv_record(cmdarg_T *cap) #ifdef FEAT_CMDWIN if (cap->nchar == ':' || cap->nchar == '/' || cap->nchar == '?') { + if (cmdwin_type != 0) + { + emsg(_(e_cmdline_window_already_open)); + return; + } stuffcharReadbuff(cap->nchar); stuffcharReadbuff(K_CMDWIN); } diff --git a/src/testdir/test_cmdwin.vim b/src/testdir/test_cmdwin.vim index 45ecdd11c6..d641b29230 100644 --- a/src/testdir/test_cmdwin.vim +++ b/src/testdir/test_cmdwin.vim @@ -356,5 +356,14 @@ func Test_cmdwin_ctrl_bsl() call assert_equal('', getcmdwintype()) endfunc +func Test_cant_open_cmdwin_in_cmdwin() + try + call feedkeys("q:q::q\<CR>", "x!") + catch + let caught = v:exception + endtry + call assert_match('E1292:', caught) +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index d7d0790a59..7534c23715 100644 --- a/src/version.c +++ b/src/version.c @@ -736,6 +736,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 64, +/**/ 63, /**/ 62, |