# HG changeset patch # User Bram Moolenaar # Date 1611697504 -3600 # Node ID 93f90f2ff4e9abccfaed8425bcffccf94edbd8e4 # Parent f0d11de94492b73995b8a865e3313ba05d93e1f4 patch 8.2.2415: no way to check for the cmdwin feature Commit: https://github.com/vim/vim/commit/21829c5f2c86cd525c8468121b4fc54c5d75bf6e Author: Bram Moolenaar Date: Tue Jan 26 22:42:21 2021 +0100 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. diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -1096,7 +1096,7 @@ 7. Command-line window *cmdline-windo 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 --- 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 --- 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 --- 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 --- 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