From 21829c5f2c86cd525c8468121b4fc54c5d75bf6e Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 26 Jan 2021 22:42:21 +0100 Subject: patch 8.2.2415: no way to check for the cmdwin feature Problem: No way to check for the cmdwin feature, cmdline_hist is now always enabled. Solution: Add has('cmdwin') support. Skip arglist test on Windows temporarily. --- runtime/doc/cmdline.txt | 2 +- src/evalfunc.c | 7 +++++++ src/testdir/test_arglist.vim | 7 ++++++- src/testdir/test_autocmd.vim | 6 ++---- src/testdir/test_cmdline.vim | 26 ++++++++++++++++++++++---- src/testdir/test_ins_complete.vim | 2 ++ src/testdir/test_normal.vim | 8 +++++--- src/testdir/test_tabpage.vim | 2 ++ src/testdir/test_termcodes.vim | 2 ++ src/testdir/test_window_cmd.vim | 2 ++ src/version.c | 2 ++ 11 files changed, 53 insertions(+), 13 deletions(-) diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index 990380f047..efb1400f19 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -1096,7 +1096,7 @@ Also see |`=|. In the command-line window the command line can be edited just like editing text in any window. It is a special kind of window, because you cannot leave it in a normal way. -{not available when compiled without the |+cmdline_hist| feature} +{not available when compiled without the |+cmdwin| feature} OPEN *c_CTRL-F* *q:* *q/* *q?* diff --git a/src/evalfunc.c b/src/evalfunc.c index cc812ce336..b752c51d10 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -4651,6 +4651,13 @@ f_has(typval_T *argvars, typval_T *rettv) }, {"cmdline_compl", 1}, {"cmdline_hist", 1}, + {"cmdwin", +#ifdef FEAT_CMDWIN + 1 +#else + 0 +#endif + }, {"comments", 1}, {"conceal", #ifdef FEAT_CONCEAL diff --git a/src/testdir/test_arglist.vim b/src/testdir/test_arglist.vim index b72fe2d534..6202993490 100644 --- a/src/testdir/test_arglist.vim +++ b/src/testdir/test_arglist.vim @@ -527,6 +527,7 @@ endfunc " Test for quitting Vim with unedited files in the argument list func Test_quit_with_arglist() CheckRunVimInTerminal + let buf = RunVimInTerminal('', {'rows': 6}) call term_sendkeys(buf, ":set nomore\n") call term_sendkeys(buf, ":args a b c\n") @@ -561,9 +562,13 @@ endfunc " Test for ":all" not working when in the cmdline window func Test_all_not_allowed_from_cmdwin() + CheckFeature cmdwin + " TODO: why does this hang on Windows? + CheckNotMSWindows + au BufEnter * all next x - call assert_fails(":norm 7q?x\", 'E11:') + call assert_fails(":norm 7q?print\", 'E11:') au! BufEnter endfunc diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index 5ec854e676..60369c2479 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -2397,10 +2397,8 @@ endfunc func Test_autocmd_CmdWinEnter() CheckRunVimInTerminal - " There is not cmdwin switch, so - " test for cmdline_hist - " (both are available with small builds) - CheckFeature cmdline_hist + CheckFeature cmdwin + let lines =<< trim END let b:dummy_var = 'This is a dummy' autocmd CmdWinEnter * quit diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index cb16de1246..c2bbcc6c0f 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -129,7 +129,6 @@ func Test_wildmenu_screendump() endfunc func Test_map_completion() - CheckFeature cmdline_compl call feedkeys(":map \\"\", 'xt') call assert_equal('"map ', getreg(':')) call feedkeys(":map