• R/O
  • SSH

vim: コミット

Mirror of the Vim source from https://github.com/vim/vim


コミットメタ情報

リビジョン93f90f2ff4e9abccfaed8425bcffccf94edbd8e4 (tree)
日時2021-01-27 06:45:04
作者Bram Moolenaar <Bram@vim....>
コミッターBram Moolenaar

ログメッセージ

patch 8.2.2415: no way to check for the cmdwin feature

Commit: https://github.com/vim/vim/commit/21829c5f2c86cd525c8468121b4fc54c5d75bf6e
Author: Bram Moolenaar <Bram@vim.org>
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 -r f0d11de94492 -r 93f90f2ff4e9 runtime/doc/cmdline.txt
--- a/runtime/doc/cmdline.txt Tue Jan 26 22:15:05 2021 +0100
+++ b/runtime/doc/cmdline.txt Tue Jan 26 22:45:04 2021 +0100
@@ -1096,7 +1096,7 @@
10961096 In the command-line window the command line can be edited just like editing
10971097 text in any window. It is a special kind of window, because you cannot leave
10981098 it in a normal way.
1099-{not available when compiled without the |+cmdline_hist| feature}
1099+{not available when compiled without the |+cmdwin| feature}
11001100
11011101
11021102 OPEN *c_CTRL-F* *q:* *q/* *q?*
diff -r f0d11de94492 -r 93f90f2ff4e9 src/evalfunc.c
--- a/src/evalfunc.c Tue Jan 26 22:15:05 2021 +0100
+++ b/src/evalfunc.c Tue Jan 26 22:45:04 2021 +0100
@@ -4651,6 +4651,13 @@
46514651 },
46524652 {"cmdline_compl", 1},
46534653 {"cmdline_hist", 1},
4654+ {"cmdwin",
4655+#ifdef FEAT_CMDWIN
4656+ 1
4657+#else
4658+ 0
4659+#endif
4660+ },
46544661 {"comments", 1},
46554662 {"conceal",
46564663 #ifdef FEAT_CONCEAL
diff -r f0d11de94492 -r 93f90f2ff4e9 src/testdir/test_arglist.vim
--- a/src/testdir/test_arglist.vim Tue Jan 26 22:15:05 2021 +0100
+++ b/src/testdir/test_arglist.vim Tue Jan 26 22:45:04 2021 +0100
@@ -527,6 +527,7 @@
527527 " Test for quitting Vim with unedited files in the argument list
528528 func Test_quit_with_arglist()
529529 CheckRunVimInTerminal
530+
530531 let buf = RunVimInTerminal('', {'rows': 6})
531532 call term_sendkeys(buf, ":set nomore\n")
532533 call term_sendkeys(buf, ":args a b c\n")
@@ -561,9 +562,13 @@
561562
562563 " Test for ":all" not working when in the cmdline window
563564 func Test_all_not_allowed_from_cmdwin()
565+ CheckFeature cmdwin
566+ " TODO: why does this hang on Windows?
567+ CheckNotMSWindows
568+
564569 au BufEnter * all
565570 next x
566- call assert_fails(":norm 7q?x\<CR>", 'E11:')
571+ call assert_fails(":norm 7q?print\<CR>", 'E11:')
567572 au! BufEnter
568573 endfunc
569574
diff -r f0d11de94492 -r 93f90f2ff4e9 src/testdir/test_autocmd.vim
--- a/src/testdir/test_autocmd.vim Tue Jan 26 22:15:05 2021 +0100
+++ b/src/testdir/test_autocmd.vim Tue Jan 26 22:45:04 2021 +0100
@@ -2397,10 +2397,8 @@
23972397
23982398 func Test_autocmd_CmdWinEnter()
23992399 CheckRunVimInTerminal
2400- " There is not cmdwin switch, so
2401- " test for cmdline_hist
2402- " (both are available with small builds)
2403- CheckFeature cmdline_hist
2400+ CheckFeature cmdwin
2401+
24042402 let lines =<< trim END
24052403 let b:dummy_var = 'This is a dummy'
24062404 autocmd CmdWinEnter * quit
diff -r f0d11de94492 -r 93f90f2ff4e9 src/testdir/test_cmdline.vim
--- a/src/testdir/test_cmdline.vim Tue Jan 26 22:15:05 2021 +0100
+++ b/src/testdir/test_cmdline.vim Tue Jan 26 22:45:04 2021 +0100
@@ -129,7 +129,6 @@
129129 endfunc
130130
131131 func Test_map_completion()
132- CheckFeature cmdline_compl
133132 call feedkeys(":map <unique> <si\<Tab>\<Home>\"\<CR>", 'xt')
134133 call assert_equal('"map <unique> <silent>', getreg(':'))
135134 call feedkeys(":map <script> <un\<Tab>\<Home>\"\<CR>", 'xt')
@@ -207,7 +206,6 @@
207206 endfunc
208207
209208 func Test_match_completion()
210- CheckFeature cmdline_compl
211209 hi Aardig ctermfg=green
212210 call feedkeys(":match \<Tab>\<Home>\"\<CR>", 'xt')
213211 call assert_equal('"match Aardig', getreg(':'))
@@ -216,7 +214,6 @@
216214 endfunc
217215
218216 func Test_highlight_completion()
219- CheckFeature cmdline_compl
220217 hi Aardig ctermfg=green
221218 call feedkeys(":hi \<Tab>\<Home>\"\<CR>", 'xt')
222219 call assert_equal('"hi Aardig', getreg(':'))
@@ -253,7 +250,6 @@
253250 endfunc
254251
255252 func Test_getcompletion()
256- CheckFeature cmdline_compl
257253 let groupcount = len(getcompletion('', 'event'))
258254 call assert_true(groupcount > 0)
259255 let matchcount = len('File'->getcompletion('event'))
@@ -980,6 +976,8 @@
980976 endfunc
981977
982978 func Test_getcmdwintype()
979+ CheckFeature cmdwin
980+
983981 call feedkeys("q/:let a = getcmdwintype()\<CR>:q\<CR>", 'x!')
984982 call assert_equal('/', a)
985983
@@ -996,6 +994,8 @@
996994 endfunc
997995
998996 func Test_getcmdwin_autocmd()
997+ CheckFeature cmdwin
998+
999999 let s:seq = []
10001000 augroup CmdWin
10011001 au WinEnter * call add(s:seq, 'WinEnter ' .. win_getid())
@@ -1108,6 +1108,8 @@
11081108 endfunc
11091109
11101110 func Test_cmdwin_bug()
1111+ CheckFeature cmdwin
1112+
11111113 let winid = win_getid()
11121114 sp
11131115 try
@@ -1118,6 +1120,7 @@
11181120 endfunc
11191121
11201122 func Test_cmdwin_restore()
1123+ CheckFeature cmdwin
11211124 CheckScreendump
11221125
11231126 let lines =<< trim [SCRIPT]
@@ -1193,6 +1196,8 @@
11931196 endfunc
11941197
11951198 func Test_cmdwin_feedkeys()
1199+ CheckFeature cmdwin
1200+
11961201 " This should not generate E488
11971202 call feedkeys("q:\<CR>", 'x')
11981203 " Using feedkeys with q: only should automatically close the cmd window
@@ -1204,6 +1209,8 @@
12041209 " Tests for the issues fixed in 7.4.441.
12051210 " When 'cedit' is set to Ctrl-C, opening the command window hangs Vim
12061211 func Test_cmdwin_cedit()
1212+ CheckFeature cmdwin
1213+
12071214 exe "set cedit=\<C-c>"
12081215 normal! :
12091216 call assert_equal(1, winnr('$'))
@@ -1226,6 +1233,8 @@
12261233
12271234 " Test for CmdwinEnter autocmd
12281235 func Test_cmdwin_autocmd()
1236+ CheckFeature cmdwin
1237+
12291238 augroup CmdWin
12301239 au!
12311240 autocmd CmdwinEnter * startinsert
@@ -1268,6 +1277,8 @@
12681277 endfunc
12691278
12701279 func Test_cmdwin_jump_to_win()
1280+ CheckFeature cmdwin
1281+
12711282 call assert_fails('call feedkeys("q:\<C-W>\<C-W>\<CR>", "xt")', 'E11:')
12721283 new
12731284 set modified
@@ -1284,6 +1295,7 @@
12841295 endfunc
12851296
12861297 func Test_cmdwin_interrupted()
1298+ CheckFeature cmdwin
12871299 CheckScreendump
12881300
12891301 " aborting the :smile output caused the cmdline window to use the current
@@ -1570,6 +1582,8 @@
15701582
15711583 " Test for recursively getting multiple command line inputs
15721584 func Test_cmdwin_multi_input()
1585+ CheckFeature cmdwin
1586+
15731587 call feedkeys(":\<C-R>=input('P: ')\<CR>\"cyan\<CR>\<CR>", 'xt')
15741588 call assert_equal('"cyan', @:)
15751589 endfunc
@@ -1594,6 +1608,8 @@
15941608
15951609 " Test for normal mode commands not supported in the cmd window
15961610 func Test_cmdwin_blocked_commands()
1611+ CheckFeature cmdwin
1612+
15971613 call assert_fails('call feedkeys("q:\<C-T>\<CR>", "xt")', 'E11:')
15981614 call assert_fails('call feedkeys("q:\<C-]>\<CR>", "xt")', 'E11:')
15991615 call assert_fails('call feedkeys("q:\<C-^>\<CR>", "xt")', 'E11:')
@@ -1625,6 +1641,8 @@
16251641
16261642 " Close the Cmd-line window in insert mode using CTRL-C
16271643 func Test_cmdwin_insert_mode_close()
1644+ CheckFeature cmdwin
1645+
16281646 %bw!
16291647 let s = ''
16301648 exe "normal q:a\<C-C>let s='Hello'\<CR>"
diff -r f0d11de94492 -r 93f90f2ff4e9 src/testdir/test_ins_complete.vim
--- a/src/testdir/test_ins_complete.vim Tue Jan 26 22:15:05 2021 +0100
+++ b/src/testdir/test_ins_complete.vim Tue Jan 26 22:45:04 2021 +0100
@@ -343,6 +343,8 @@
343343 endfunc
344344
345345 func Test_compl_in_cmdwin()
346+ CheckFeature cmdwin
347+
346348 set wildmenu wildchar=<Tab>
347349 com! -nargs=1 -complete=command GetInput let input = <q-args>
348350 com! -buffer TestCommand echo 'TestCommand'
diff -r f0d11de94492 -r 93f90f2ff4e9 src/testdir/test_normal.vim
--- a/src/testdir/test_normal.vim Tue Jan 26 22:15:05 2021 +0100
+++ b/src/testdir/test_normal.vim Tue Jan 26 22:45:04 2021 +0100
@@ -2584,9 +2584,11 @@
25842584 call assert_false(&insertmode)
25852585 call assert_beeps("normal! \<C-\>\<C-A>", 'xt')
25862586
2587- " Using CTRL-\ CTRL-N in cmd window should close the window
2588- call feedkeys("q:\<C-\>\<C-N>", 'xt')
2589- call assert_equal('', getcmdwintype())
2587+ if has('cmdwin')
2588+ " Using CTRL-\ CTRL-N in cmd window should close the window
2589+ call feedkeys("q:\<C-\>\<C-N>", 'xt')
2590+ call assert_equal('', getcmdwintype())
2591+ endif
25902592
25912593 " clean up
25922594 bw!
diff -r f0d11de94492 -r 93f90f2ff4e9 src/testdir/test_tabpage.vim
--- a/src/testdir/test_tabpage.vim Tue Jan 26 22:15:05 2021 +0100
+++ b/src/testdir/test_tabpage.vim Tue Jan 26 22:45:04 2021 +0100
@@ -617,6 +617,8 @@
617617
618618 " Test for closing the tab page from a command window
619619 func Test_tabpage_close_cmdwin()
620+ CheckFeature cmdwin
621+
620622 tabnew
621623 call feedkeys("q/:tabclose\<CR>\<Esc>", 'xt')
622624 call assert_equal(2, tabpagenr('$'))
diff -r f0d11de94492 -r 93f90f2ff4e9 src/testdir/test_termcodes.vim
--- a/src/testdir/test_termcodes.vim Tue Jan 26 22:15:05 2021 +0100
+++ b/src/testdir/test_termcodes.vim Tue Jan 26 22:45:04 2021 +0100
@@ -367,6 +367,8 @@
367367
368368 " Test for using the mouse to increaes the height of the cmdline window
369369 func Test_mouse_cmdwin_resize()
370+ CheckFeature cmdwin
371+
370372 let save_mouse = &mouse
371373 let save_term = &term
372374 let save_ttymouse = &ttymouse
diff -r f0d11de94492 -r 93f90f2ff4e9 src/testdir/test_window_cmd.vim
--- a/src/testdir/test_window_cmd.vim Tue Jan 26 22:15:05 2021 +0100
+++ b/src/testdir/test_window_cmd.vim Tue Jan 26 22:45:04 2021 +0100
@@ -19,6 +19,8 @@
1919 endfunc
2020
2121 func Test_window_cmd_cmdwin_with_vsp()
22+ CheckFeature cmdwin
23+
2224 let efmt = 'Expected 0 but got %d (in ls=%d, %s window)'
2325 for v in range(0, 2)
2426 exec "set ls=" . v
diff -r f0d11de94492 -r 93f90f2ff4e9 src/version.c
--- a/src/version.c Tue Jan 26 22:15:05 2021 +0100
+++ b/src/version.c Tue Jan 26 22:45:04 2021 +0100
@@ -751,6 +751,8 @@
751751 static int included_patches[] =
752752 { /* Add new patch number below this line */
753753 /**/
754+ 2415,
755+/**/
754756 2414,
755757 /**/
756758 2413,
旧リポジトリブラウザで表示