Patch 8.2.2415
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.
Files: runtime/doc/cmdline.txt, src/evalfunc.c,
src/testdir/test_autocmd.vim, src/testdir/test_arglist.vim,
src/testdir/test_cmdline.vim, src/testdir/test_ins_complete.vim,
src/testdir/test_normal.vim, src/testdir/test_tabpage.vim,
src/testdir/test_termcodes.vim, src/testdir/test_window_cmd.vim
*** ../vim-8.2.2414/runtime/doc/cmdline.txt 2020-07-26 15:36:12.959172993 +0200
--- runtime/doc/cmdline.txt 2021-01-26 22:26:27.905473276 +0100
***************
*** 1077,1083 ****
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}
OPEN *c_CTRL-F* *q:* *q/* *q?*
--- 1096,1102 ----
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 |+cmdwin| feature}
OPEN *c_CTRL-F* *q:* *q/* *q?*
*** ../vim-8.2.2414/src/evalfunc.c 2021-01-22 22:31:06.676005413 +0100
--- src/evalfunc.c 2021-01-26 22:24:25.061841721 +0100
***************
*** 4651,4656 ****
--- 4651,4663 ----
},
{"cmdline_compl", 1},
{"cmdline_hist", 1},
+ {"cmdwin",
+ #ifdef FEAT_CMDWIN
+ 1
+ #else
+ 0
+ #endif
+ },
{"comments", 1},
{"conceal",
#ifdef FEAT_CONCEAL
*** ../vim-8.2.2414/src/testdir/test_autocmd.vim 2021-01-16 13:11:39.102733790 +0100
--- src/testdir/test_autocmd.vim 2021-01-26 22:26:06.009538196 +0100
***************
*** 2397,2406 ****
func Test_autocmd_CmdWinEnter()
CheckRunVimInTerminal
! " There is not cmdwin switch, so
! " test for cmdline_hist
! " (both are available with small builds)
! CheckFeature cmdline_hist
let lines =<< trim END
let b:dummy_var = 'This is a dummy'
autocmd CmdWinEnter * quit
--- 2397,2404 ----
func Test_autocmd_CmdWinEnter()
CheckRunVimInTerminal
! CheckFeature cmdwin
!
let lines =<< trim END
let b:dummy_var = 'This is a dummy'
autocmd CmdWinEnter * quit
*** ../vim-8.2.2414/src/testdir/test_arglist.vim 2021-01-26 21:35:05.048158026 +0100
--- src/testdir/test_arglist.vim 2021-01-26 22:40:17.583159089 +0100
***************
*** 527,532 ****
--- 527,533 ----
" 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,569 ****
" Test for ":all" not working when in the cmdline window
func Test_all_not_allowed_from_cmdwin()
au BufEnter * all
next x
! call assert_fails(":norm 7q?x\<CR>", 'E11:')
au! BufEnter
endfunc
--- 562,574 ----
" 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?print\<CR>", 'E11:')
au! BufEnter
endfunc
*** ../vim-8.2.2414/src/testdir/test_cmdline.vim 2021-01-13 19:48:41.628312470 +0100
--- src/testdir/test_cmdline.vim 2021-01-26 22:31:01.940683415 +0100
***************
*** 129,135 ****
endfunc
func Test_map_completion()
- CheckFeature cmdline_compl
call feedkeys(":map <unique> <si\<Tab>\<Home>\"\<CR>", 'xt')
call assert_equal('"map <unique> <silent>', getreg(':'))
call feedkeys(":map <script> <un\<Tab>\<Home>\"\<CR>", 'xt')
--- 129,134 ----
***************
*** 207,213 ****
endfunc
func Test_match_completion()
- CheckFeature cmdline_compl
hi Aardig ctermfg=green
call feedkeys(":match \<Tab>\<Home>\"\<CR>", 'xt')
call assert_equal('"match Aardig', getreg(':'))
--- 206,211 ----
***************
*** 216,222 ****
endfunc
func Test_highlight_completion()
- CheckFeature cmdline_compl
hi Aardig ctermfg=green
call feedkeys(":hi \<Tab>\<Home>\"\<CR>", 'xt')
call assert_equal('"hi Aardig', getreg(':'))
--- 214,219 ----
***************
*** 253,259 ****
endfunc
func Test_getcompletion()
- CheckFeature cmdline_compl
let groupcount = len(getcompletion('', 'event'))
call assert_true(groupcount > 0)
let matchcount = len('File'->getcompletion('event'))
--- 250,255 ----
***************
*** 980,985 ****
--- 976,983 ----
endfunc
func Test_getcmdwintype()
+ CheckFeature cmdwin
+
call feedkeys("q/:let a = getcmdwintype()\<CR>:q\<CR>", 'x!')
call assert_equal('/', a)
***************
*** 996,1001 ****
--- 994,1001 ----
endfunc
func Test_getcmdwin_autocmd()
+ CheckFeature cmdwin
+
let s:seq = []
augroup CmdWin
au WinEnter * call add(s:seq, 'WinEnter ' .. win_getid())
***************
*** 1108,1113 ****
--- 1108,1115 ----
endfunc
func Test_cmdwin_bug()
+ CheckFeature cmdwin
+
let winid = win_getid()
sp
try
***************
*** 1118,1123 ****
--- 1120,1126 ----
endfunc
func Test_cmdwin_restore()
+ CheckFeature cmdwin
CheckScreendump
let lines =<< trim [SCRIPT]
***************
*** 1193,1198 ****
--- 1196,1203 ----
endfunc
func Test_cmdwin_feedkeys()
+ CheckFeature cmdwin
+
" This should not generate E488
call feedkeys("q:\<CR>", 'x')
" Using feedkeys with q: only should automatically close the cmd window
***************
*** 1204,1209 ****
--- 1209,1216 ----
" Tests for the issues fixed in 7.4.441.
" When 'cedit' is set to Ctrl-C, opening the command window hangs Vim
func Test_cmdwin_cedit()
+ CheckFeature cmdwin
+
exe "set cedit=\<C-c>"
normal! :
call assert_equal(1, winnr('$'))
***************
*** 1226,1231 ****
--- 1233,1240 ----
" Test for CmdwinEnter autocmd
func Test_cmdwin_autocmd()
+ CheckFeature cmdwin
+
augroup CmdWin
au!
autocmd CmdwinEnter * startinsert
***************
*** 1268,1273 ****
--- 1277,1284 ----
endfunc
func Test_cmdwin_jump_to_win()
+ CheckFeature cmdwin
+
call assert_fails('call feedkeys("q:\<C-W>\<C-W>\<CR>", "xt")', 'E11:')
new
set modified
***************
*** 1284,1289 ****
--- 1295,1301 ----
endfunc
func Test_cmdwin_interrupted()
+ CheckFeature cmdwin
CheckScreendump
" aborting the :smile output caused the cmdline window to use the current
***************
*** 1570,1575 ****
--- 1582,1589 ----
" Test for recursively getting multiple command line inputs
func Test_cmdwin_multi_input()
+ CheckFeature cmdwin
+
call feedkeys(":\<C-R>=input('P: ')\<CR>\"cyan\<CR>\<CR>", 'xt')
call assert_equal('"cyan', @:)
endfunc
***************
*** 1594,1599 ****
--- 1608,1615 ----
" Test for normal mode commands not supported in the cmd window
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-]>\<CR>", "xt")', 'E11:')
call assert_fails('call feedkeys("q:\<C-^>\<CR>", "xt")', 'E11:')
***************
*** 1625,1630 ****
--- 1641,1648 ----
" Close the Cmd-line window in insert mode using CTRL-C
func Test_cmdwin_insert_mode_close()
+ CheckFeature cmdwin
+
%bw!
let s = ''
exe "normal q:a\<C-C>let s='Hello'\<CR>"
*** ../vim-8.2.2414/src/testdir/test_ins_complete.vim 2020-12-12 13:31:51.277403018 +0100
--- src/testdir/test_ins_complete.vim 2021-01-26 22:31:13.164651787 +0100
***************
*** 343,348 ****
--- 343,350 ----
endfunc
func Test_compl_in_cmdwin()
+ CheckFeature cmdwin
+
set wildmenu wildchar=<Tab>
com! -nargs=1 -complete=command GetInput let input = <q-args>
com! -buffer TestCommand echo 'TestCommand'
*** ../vim-8.2.2414/src/testdir/test_normal.vim 2020-10-07 16:54:48.523247873 +0200
--- src/testdir/test_normal.vim 2021-01-26 22:32:20.348463475 +0100
***************
*** 2584,2592 ****
call assert_false(&insertmode)
call assert_beeps("normal! \<C-\>\<C-A>", 'xt')
! " Using CTRL-\ CTRL-N in cmd window should close the window
! call feedkeys("q:\<C-\>\<C-N>", 'xt')
! call assert_equal('', getcmdwintype())
" clean up
bw!
--- 2584,2594 ----
call assert_false(&insertmode)
call assert_beeps("normal! \<C-\>\<C-A>", 'xt')
! if has('cmdwin')
! " Using CTRL-\ CTRL-N in cmd window should close the window
! call feedkeys("q:\<C-\>\<C-N>", 'xt')
! call assert_equal('', getcmdwintype())
! endif
" clean up
bw!
*** ../vim-8.2.2414/src/testdir/test_tabpage.vim 2020-10-04 16:16:50.919838655 +0200
--- src/testdir/test_tabpage.vim 2021-01-26 22:32:48.232385761 +0100
***************
*** 617,622 ****
--- 617,624 ----
" Test for closing the tab page from a command window
func Test_tabpage_close_cmdwin()
+ CheckFeature cmdwin
+
tabnew
call feedkeys("q/:tabclose\<CR>\<Esc>", 'xt')
call assert_equal(2, tabpagenr('$'))
*** ../vim-8.2.2414/src/testdir/test_termcodes.vim 2020-12-30 14:59:18.135318174 +0100
--- src/testdir/test_termcodes.vim 2021-01-26 22:33:04.936339320 +0100
***************
*** 367,372 ****
--- 367,374 ----
" Test for using the mouse to increaes the height of the cmdline window
func Test_mouse_cmdwin_resize()
+ CheckFeature cmdwin
+
let save_mouse = &mouse
let save_term = &term
let save_ttymouse = &ttymouse
*** ../vim-8.2.2414/src/testdir/test_window_cmd.vim 2021-01-01 14:31:30.204198897 +0100
--- src/testdir/test_window_cmd.vim 2021-01-26 22:33:24.980283693 +0100
***************
*** 19,24 ****
--- 19,26 ----
endfunc
func Test_window_cmd_cmdwin_with_vsp()
+ CheckFeature cmdwin
+
let efmt = 'Expected 0 but got %d (in ls=%d, %s window)'
for v in range(0, 2)
exec "set ls=" . v
*** ../vim-8.2.2414/src/version.c 2021-01-26 22:00:47.882149627 +0100
--- src/version.c 2021-01-26 22:26:40.813435166 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2415,
/**/
--
hundred-and-one symptoms of being an internet addict:
249. You've forgotten what the outside looks like.
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language --
http://www.Zimbu.org ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///