mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
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.
This commit is contained in:
@@ -1096,7 +1096,7 @@ Also see |`=|.
|
|||||||
In the command-line window the command line can be edited just like editing
|
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
|
text in any window. It is a special kind of window, because you cannot leave
|
||||||
it in a normal way.
|
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?*
|
OPEN *c_CTRL-F* *q:* *q/* *q?*
|
||||||
|
@@ -4651,6 +4651,13 @@ f_has(typval_T *argvars, typval_T *rettv)
|
|||||||
},
|
},
|
||||||
{"cmdline_compl", 1},
|
{"cmdline_compl", 1},
|
||||||
{"cmdline_hist", 1},
|
{"cmdline_hist", 1},
|
||||||
|
{"cmdwin",
|
||||||
|
#ifdef FEAT_CMDWIN
|
||||||
|
1
|
||||||
|
#else
|
||||||
|
0
|
||||||
|
#endif
|
||||||
|
},
|
||||||
{"comments", 1},
|
{"comments", 1},
|
||||||
{"conceal",
|
{"conceal",
|
||||||
#ifdef FEAT_CONCEAL
|
#ifdef FEAT_CONCEAL
|
||||||
|
@@ -527,6 +527,7 @@ endfunc
|
|||||||
" Test for quitting Vim with unedited files in the argument list
|
" Test for quitting Vim with unedited files in the argument list
|
||||||
func Test_quit_with_arglist()
|
func Test_quit_with_arglist()
|
||||||
CheckRunVimInTerminal
|
CheckRunVimInTerminal
|
||||||
|
|
||||||
let buf = RunVimInTerminal('', {'rows': 6})
|
let buf = RunVimInTerminal('', {'rows': 6})
|
||||||
call term_sendkeys(buf, ":set nomore\n")
|
call term_sendkeys(buf, ":set nomore\n")
|
||||||
call term_sendkeys(buf, ":args a b c\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
|
" Test for ":all" not working when in the cmdline window
|
||||||
func Test_all_not_allowed_from_cmdwin()
|
func Test_all_not_allowed_from_cmdwin()
|
||||||
|
CheckFeature cmdwin
|
||||||
|
" TODO: why does this hang on Windows?
|
||||||
|
CheckNotMSWindows
|
||||||
|
|
||||||
au BufEnter * all
|
au BufEnter * all
|
||||||
next x
|
next x
|
||||||
call assert_fails(":norm 7q?x\<CR>", 'E11:')
|
call assert_fails(":norm 7q?print\<CR>", 'E11:')
|
||||||
au! BufEnter
|
au! BufEnter
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@@ -2397,10 +2397,8 @@ endfunc
|
|||||||
|
|
||||||
func Test_autocmd_CmdWinEnter()
|
func Test_autocmd_CmdWinEnter()
|
||||||
CheckRunVimInTerminal
|
CheckRunVimInTerminal
|
||||||
" There is not cmdwin switch, so
|
CheckFeature cmdwin
|
||||||
" test for cmdline_hist
|
|
||||||
" (both are available with small builds)
|
|
||||||
CheckFeature cmdline_hist
|
|
||||||
let lines =<< trim END
|
let lines =<< trim END
|
||||||
let b:dummy_var = 'This is a dummy'
|
let b:dummy_var = 'This is a dummy'
|
||||||
autocmd CmdWinEnter * quit
|
autocmd CmdWinEnter * quit
|
||||||
|
@@ -129,7 +129,6 @@ func Test_wildmenu_screendump()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_map_completion()
|
func Test_map_completion()
|
||||||
CheckFeature cmdline_compl
|
|
||||||
call feedkeys(":map <unique> <si\<Tab>\<Home>\"\<CR>", 'xt')
|
call feedkeys(":map <unique> <si\<Tab>\<Home>\"\<CR>", 'xt')
|
||||||
call assert_equal('"map <unique> <silent>', getreg(':'))
|
call assert_equal('"map <unique> <silent>', getreg(':'))
|
||||||
call feedkeys(":map <script> <un\<Tab>\<Home>\"\<CR>", 'xt')
|
call feedkeys(":map <script> <un\<Tab>\<Home>\"\<CR>", 'xt')
|
||||||
@@ -207,7 +206,6 @@ func Test_map_completion()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_match_completion()
|
func Test_match_completion()
|
||||||
CheckFeature cmdline_compl
|
|
||||||
hi Aardig ctermfg=green
|
hi Aardig ctermfg=green
|
||||||
call feedkeys(":match \<Tab>\<Home>\"\<CR>", 'xt')
|
call feedkeys(":match \<Tab>\<Home>\"\<CR>", 'xt')
|
||||||
call assert_equal('"match Aardig', getreg(':'))
|
call assert_equal('"match Aardig', getreg(':'))
|
||||||
@@ -216,7 +214,6 @@ func Test_match_completion()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_highlight_completion()
|
func Test_highlight_completion()
|
||||||
CheckFeature cmdline_compl
|
|
||||||
hi Aardig ctermfg=green
|
hi Aardig ctermfg=green
|
||||||
call feedkeys(":hi \<Tab>\<Home>\"\<CR>", 'xt')
|
call feedkeys(":hi \<Tab>\<Home>\"\<CR>", 'xt')
|
||||||
call assert_equal('"hi Aardig', getreg(':'))
|
call assert_equal('"hi Aardig', getreg(':'))
|
||||||
@@ -253,7 +250,6 @@ func Test_highlight_easter_egg()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_getcompletion()
|
func Test_getcompletion()
|
||||||
CheckFeature cmdline_compl
|
|
||||||
let groupcount = len(getcompletion('', 'event'))
|
let groupcount = len(getcompletion('', 'event'))
|
||||||
call assert_true(groupcount > 0)
|
call assert_true(groupcount > 0)
|
||||||
let matchcount = len('File'->getcompletion('event'))
|
let matchcount = len('File'->getcompletion('event'))
|
||||||
@@ -980,6 +976,8 @@ func Test_getcmdtype()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_getcmdwintype()
|
func Test_getcmdwintype()
|
||||||
|
CheckFeature cmdwin
|
||||||
|
|
||||||
call feedkeys("q/:let a = getcmdwintype()\<CR>:q\<CR>", 'x!')
|
call feedkeys("q/:let a = getcmdwintype()\<CR>:q\<CR>", 'x!')
|
||||||
call assert_equal('/', a)
|
call assert_equal('/', a)
|
||||||
|
|
||||||
@@ -996,6 +994,8 @@ func Test_getcmdwintype()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_getcmdwin_autocmd()
|
func Test_getcmdwin_autocmd()
|
||||||
|
CheckFeature cmdwin
|
||||||
|
|
||||||
let s:seq = []
|
let s:seq = []
|
||||||
augroup CmdWin
|
augroup CmdWin
|
||||||
au WinEnter * call add(s:seq, 'WinEnter ' .. win_getid())
|
au WinEnter * call add(s:seq, 'WinEnter ' .. win_getid())
|
||||||
@@ -1108,6 +1108,8 @@ func Test_cmdline_overstrike()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_cmdwin_bug()
|
func Test_cmdwin_bug()
|
||||||
|
CheckFeature cmdwin
|
||||||
|
|
||||||
let winid = win_getid()
|
let winid = win_getid()
|
||||||
sp
|
sp
|
||||||
try
|
try
|
||||||
@@ -1118,6 +1120,7 @@ func Test_cmdwin_bug()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_cmdwin_restore()
|
func Test_cmdwin_restore()
|
||||||
|
CheckFeature cmdwin
|
||||||
CheckScreendump
|
CheckScreendump
|
||||||
|
|
||||||
let lines =<< trim [SCRIPT]
|
let lines =<< trim [SCRIPT]
|
||||||
@@ -1193,6 +1196,8 @@ func Test_buffers_lastused()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_cmdwin_feedkeys()
|
func Test_cmdwin_feedkeys()
|
||||||
|
CheckFeature cmdwin
|
||||||
|
|
||||||
" This should not generate E488
|
" This should not generate E488
|
||||||
call feedkeys("q:\<CR>", 'x')
|
call feedkeys("q:\<CR>", 'x')
|
||||||
" Using feedkeys with q: only should automatically close the cmd window
|
" Using feedkeys with q: only should automatically close the cmd window
|
||||||
@@ -1204,6 +1209,8 @@ endfunc
|
|||||||
" Tests for the issues fixed in 7.4.441.
|
" Tests for the issues fixed in 7.4.441.
|
||||||
" When 'cedit' is set to Ctrl-C, opening the command window hangs Vim
|
" When 'cedit' is set to Ctrl-C, opening the command window hangs Vim
|
||||||
func Test_cmdwin_cedit()
|
func Test_cmdwin_cedit()
|
||||||
|
CheckFeature cmdwin
|
||||||
|
|
||||||
exe "set cedit=\<C-c>"
|
exe "set cedit=\<C-c>"
|
||||||
normal! :
|
normal! :
|
||||||
call assert_equal(1, winnr('$'))
|
call assert_equal(1, winnr('$'))
|
||||||
@@ -1226,6 +1233,8 @@ endfunc
|
|||||||
|
|
||||||
" Test for CmdwinEnter autocmd
|
" Test for CmdwinEnter autocmd
|
||||||
func Test_cmdwin_autocmd()
|
func Test_cmdwin_autocmd()
|
||||||
|
CheckFeature cmdwin
|
||||||
|
|
||||||
augroup CmdWin
|
augroup CmdWin
|
||||||
au!
|
au!
|
||||||
autocmd CmdwinEnter * startinsert
|
autocmd CmdwinEnter * startinsert
|
||||||
@@ -1268,6 +1277,8 @@ func Test_cmdline_expand_special()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_cmdwin_jump_to_win()
|
func Test_cmdwin_jump_to_win()
|
||||||
|
CheckFeature cmdwin
|
||||||
|
|
||||||
call assert_fails('call feedkeys("q:\<C-W>\<C-W>\<CR>", "xt")', 'E11:')
|
call assert_fails('call feedkeys("q:\<C-W>\<C-W>\<CR>", "xt")', 'E11:')
|
||||||
new
|
new
|
||||||
set modified
|
set modified
|
||||||
@@ -1284,6 +1295,7 @@ func Test_cmdwin_jump_to_win()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_cmdwin_interrupted()
|
func Test_cmdwin_interrupted()
|
||||||
|
CheckFeature cmdwin
|
||||||
CheckScreendump
|
CheckScreendump
|
||||||
|
|
||||||
" aborting the :smile output caused the cmdline window to use the current
|
" aborting the :smile output caused the cmdline window to use the current
|
||||||
@@ -1570,6 +1582,8 @@ endfunc
|
|||||||
|
|
||||||
" Test for recursively getting multiple command line inputs
|
" Test for recursively getting multiple command line inputs
|
||||||
func Test_cmdwin_multi_input()
|
func Test_cmdwin_multi_input()
|
||||||
|
CheckFeature cmdwin
|
||||||
|
|
||||||
call feedkeys(":\<C-R>=input('P: ')\<CR>\"cyan\<CR>\<CR>", 'xt')
|
call feedkeys(":\<C-R>=input('P: ')\<CR>\"cyan\<CR>\<CR>", 'xt')
|
||||||
call assert_equal('"cyan', @:)
|
call assert_equal('"cyan', @:)
|
||||||
endfunc
|
endfunc
|
||||||
@@ -1594,6 +1608,8 @@ endfunc
|
|||||||
|
|
||||||
" Test for normal mode commands not supported in the cmd window
|
" Test for normal mode commands not supported in the cmd window
|
||||||
func Test_cmdwin_blocked_commands()
|
func Test_cmdwin_blocked_commands()
|
||||||
|
CheckFeature cmdwin
|
||||||
|
|
||||||
call assert_fails('call feedkeys("q:\<C-T>\<CR>", "xt")', 'E11:')
|
call assert_fails('call feedkeys("q:\<C-T>\<CR>", "xt")', 'E11:')
|
||||||
call assert_fails('call feedkeys("q:\<C-]>\<CR>", "xt")', 'E11:')
|
call assert_fails('call feedkeys("q:\<C-]>\<CR>", "xt")', 'E11:')
|
||||||
call assert_fails('call feedkeys("q:\<C-^>\<CR>", "xt")', 'E11:')
|
call assert_fails('call feedkeys("q:\<C-^>\<CR>", "xt")', 'E11:')
|
||||||
@@ -1625,6 +1641,8 @@ endfunc
|
|||||||
|
|
||||||
" Close the Cmd-line window in insert mode using CTRL-C
|
" Close the Cmd-line window in insert mode using CTRL-C
|
||||||
func Test_cmdwin_insert_mode_close()
|
func Test_cmdwin_insert_mode_close()
|
||||||
|
CheckFeature cmdwin
|
||||||
|
|
||||||
%bw!
|
%bw!
|
||||||
let s = ''
|
let s = ''
|
||||||
exe "normal q:a\<C-C>let s='Hello'\<CR>"
|
exe "normal q:a\<C-C>let s='Hello'\<CR>"
|
||||||
|
@@ -343,6 +343,8 @@ func Test_compl_feedkeys()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_compl_in_cmdwin()
|
func Test_compl_in_cmdwin()
|
||||||
|
CheckFeature cmdwin
|
||||||
|
|
||||||
set wildmenu wildchar=<Tab>
|
set wildmenu wildchar=<Tab>
|
||||||
com! -nargs=1 -complete=command GetInput let input = <q-args>
|
com! -nargs=1 -complete=command GetInput let input = <q-args>
|
||||||
com! -buffer TestCommand echo 'TestCommand'
|
com! -buffer TestCommand echo 'TestCommand'
|
||||||
|
@@ -2584,9 +2584,11 @@ func Test_normal40_ctrl_bsl()
|
|||||||
call assert_false(&insertmode)
|
call assert_false(&insertmode)
|
||||||
call assert_beeps("normal! \<C-\>\<C-A>", 'xt')
|
call assert_beeps("normal! \<C-\>\<C-A>", 'xt')
|
||||||
|
|
||||||
" Using CTRL-\ CTRL-N in cmd window should close the window
|
if has('cmdwin')
|
||||||
call feedkeys("q:\<C-\>\<C-N>", 'xt')
|
" Using CTRL-\ CTRL-N in cmd window should close the window
|
||||||
call assert_equal('', getcmdwintype())
|
call feedkeys("q:\<C-\>\<C-N>", 'xt')
|
||||||
|
call assert_equal('', getcmdwintype())
|
||||||
|
endif
|
||||||
|
|
||||||
" clean up
|
" clean up
|
||||||
bw!
|
bw!
|
||||||
|
@@ -617,6 +617,8 @@ endfunc
|
|||||||
|
|
||||||
" Test for closing the tab page from a command window
|
" Test for closing the tab page from a command window
|
||||||
func Test_tabpage_close_cmdwin()
|
func Test_tabpage_close_cmdwin()
|
||||||
|
CheckFeature cmdwin
|
||||||
|
|
||||||
tabnew
|
tabnew
|
||||||
call feedkeys("q/:tabclose\<CR>\<Esc>", 'xt')
|
call feedkeys("q/:tabclose\<CR>\<Esc>", 'xt')
|
||||||
call assert_equal(2, tabpagenr('$'))
|
call assert_equal(2, tabpagenr('$'))
|
||||||
|
@@ -367,6 +367,8 @@ endfunc
|
|||||||
|
|
||||||
" Test for using the mouse to increaes the height of the cmdline window
|
" Test for using the mouse to increaes the height of the cmdline window
|
||||||
func Test_mouse_cmdwin_resize()
|
func Test_mouse_cmdwin_resize()
|
||||||
|
CheckFeature cmdwin
|
||||||
|
|
||||||
let save_mouse = &mouse
|
let save_mouse = &mouse
|
||||||
let save_term = &term
|
let save_term = &term
|
||||||
let save_ttymouse = &ttymouse
|
let save_ttymouse = &ttymouse
|
||||||
|
@@ -19,6 +19,8 @@ func Test_window_cmd_ls0_with_split()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_window_cmd_cmdwin_with_vsp()
|
func Test_window_cmd_cmdwin_with_vsp()
|
||||||
|
CheckFeature cmdwin
|
||||||
|
|
||||||
let efmt = 'Expected 0 but got %d (in ls=%d, %s window)'
|
let efmt = 'Expected 0 but got %d (in ls=%d, %s window)'
|
||||||
for v in range(0, 2)
|
for v in range(0, 2)
|
||||||
exec "set ls=" . v
|
exec "set ls=" . v
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2415,
|
||||||
/**/
|
/**/
|
||||||
2414,
|
2414,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user