diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-12-01 15:23:11 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-12-01 15:23:11 +0100 |
commit | 5a4c3082d7ab51b3d448a91578479c96c1ab0ad3 (patch) | |
tree | a25f441743857c618f3f019372a284b1d57c4e0d /src | |
parent | 9625d3d92d93be52f5d89a57b27ba2400e0fc6d2 (diff) |
patch 8.1.2373: cannot build with +popupwin but without +quickfixv8.1.2373
Problem: Cannot build with +popupwin but without +quickfix. (John Marriott)
Solution: Adjust #ifdefs.
Diffstat (limited to 'src')
27 files changed, 228 insertions, 145 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 78f2bcc6b2..a1eecc505b 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -3016,7 +3016,7 @@ do_ecmd( #ifdef FEAT_TITLE maketitle(); #endif -#ifdef FEAT_PROP_POPUP +#if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX) if (WIN_IS_POPUP(curwin) && curwin->w_p_pvw && retval != FAIL) popup_set_title(curwin); #endif diff --git a/src/fileio.c b/src/fileio.c index 802b997ac5..c15c7bd28d 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3366,7 +3366,7 @@ shorten_fnames(int force) } status_redraw_all(); redraw_tabline = TRUE; -#ifdef FEAT_PROP_POPUP +#if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX) popup_update_preview_title(); #endif } diff --git a/src/popupmenu.c b/src/popupmenu.c index f11ae943a2..76255aa97f 100644 --- a/src/popupmenu.c +++ b/src/popupmenu.c @@ -621,7 +621,7 @@ pum_redraw(void) #endif } -#if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX) +#if (defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX)) || defined(PROTO) /* * Position the info popup relative to the popup menu item. */ @@ -683,7 +683,7 @@ pum_set_selected(int n, int repeat UNUSED) #ifdef FEAT_QUICKFIX int prev_selected = pum_selected; #endif -#ifdef FEAT_PROP_POPUP +#if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX) int has_info = FALSE; #endif diff --git a/src/popupwin.c b/src/popupwin.c index 5385296a3d..dc09ef3a57 100644 --- a/src/popupwin.c +++ b/src/popupwin.c @@ -2386,8 +2386,10 @@ f_popup_show(typval_T *argvars, typval_T *rettv UNUSED) if (wp != NULL) { popup_show(wp); +#ifdef FEAT_QUICKFIX if (wp->w_popup_flags & POPF_INFO) pum_position_info_popup(wp); +#endif } } @@ -3686,6 +3688,13 @@ set_ref_in_popups(int copyID) return abort; } + int +popup_is_popup(win_T *wp) +{ + return wp->w_popup_flags != 0; +} + +#if defined(FEAT_QUICKFIX) || defined(PROTO) /* * Find an existing popup used as the preview window, in the current tab page. * Return NULL if not found. @@ -3702,13 +3711,6 @@ popup_find_preview_window(void) return NULL; } - int -popup_is_popup(win_T *wp) -{ - return wp->w_popup_flags != 0; -} - -#if defined(FEAT_QUICKFIX) || defined(PROTO) /* * Find an existing popup used as the info window, in the current tab page. * Return NULL if not found. @@ -3729,19 +3731,28 @@ popup_find_info_window(void) void f_popup_findinfo(typval_T *argvars UNUSED, typval_T *rettv) { +#ifdef FEAT_QUICKFIX win_T *wp = popup_find_info_window(); rettv->vval.v_number = wp == NULL ? 0 : wp->w_id; +#else + rettv->vval.v_number = 0; +#endif } void f_popup_findpreview(typval_T *argvars UNUSED, typval_T *rettv) { +#ifdef FEAT_QUICKFIX win_T *wp = popup_find_preview_window(); rettv->vval.v_number = wp == NULL ? 0 : wp->w_id; +#else + rettv->vval.v_number = 0; +#endif } +#if defined(FEAT_QUICKFIX) || defined(PROTO) /* * Create a popup to be used as the preview or info window. * NOTE: this makes the popup the current window, so that the file can be @@ -3775,7 +3786,6 @@ popup_create_preview_window(int info) return OK; } -#if defined(FEAT_QUICKFIX) || defined(PROTO) /* * Close any preview popup. */ @@ -3851,6 +3861,7 @@ popup_set_title(win_T *wp) } } +# if defined(FEAT_QUICKFIX) || defined(PROTO) /* * If there is a preview window, update the title. * Used after changing directory. @@ -3863,5 +3874,6 @@ popup_update_preview_title(void) if (wp != NULL) popup_set_title(wp); } +# endif #endif // FEAT_PROP_POPUP diff --git a/src/testdir/test86.in b/src/testdir/test86.in index 71dd9f1fd8..6a26189366 100644 --- a/src/testdir/test86.in +++ b/src/testdir/test86.in @@ -9,7 +9,7 @@ STARTTEST :so small.vim :set encoding=latin1 :set noswapfile -:if !has('python') | e! test.ok | wq! test.out | endif +:if !has('python') || !has('quickfix') | e! test.ok | wq! test.out | endif :lang C :fun Test() :py import vim diff --git a/src/testdir/test87.in b/src/testdir/test87.in index 31de37b997..8bd5bf72b5 100644 --- a/src/testdir/test87.in +++ b/src/testdir/test87.in @@ -3,7 +3,7 @@ Tests for various python features. vim: set ft=vim : STARTTEST :so small.vim :set noswapfile -:if !has('python3') | e! test.ok | wq! test.out | endif +:if !has('python3') || !has('quickfix') | e! test.ok | wq! test.out | endif :lang C :fun Test() :py3 import vim diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index 6d1897a4aa..c16a679da3 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -1713,10 +1713,12 @@ func Test_nocatch_wipe_all_buffers() endfunc func Test_nocatch_wipe_dummy_buffer() - " Nasty autocommand: wipe buffer on any event. - au * x bwipe - call assert_fails('lv½ /x', 'E480') - au! + if has('quickfix') + " Nasty autocommand: wipe buffer on any event. + au * x bwipe + call assert_fails('lv½ /x', 'E480') + au! + endif endfunc function s:Before_test_dirchanged() @@ -2291,6 +2293,8 @@ func Test_autocmd_CmdWinEnter() endfunc func Test_autocmd_was_using_freed_memory() + CheckFeature quickfix + pedit xx n x au WinEnter * quit diff --git a/src/testdir/test_bufwintabinfo.vim b/src/testdir/test_bufwintabinfo.vim index b4b8a109bd..bebaca6281 100644 --- a/src/testdir/test_bufwintabinfo.vim +++ b/src/testdir/test_bufwintabinfo.vim @@ -1,109 +1,112 @@ " Tests for the getbufinfo(), getwininfo() and gettabinfo() functions +source check.vim -function Test_getbufwintabinfo() - edit Xtestfile1 - edit Xtestfile2 - let buflist = getbufinfo() - call assert_equal(2, len(buflist)) - call assert_match('Xtestfile1', buflist[0].name) - call assert_match('Xtestfile2', getbufinfo('Xtestfile2')[0].name) - call assert_equal([], getbufinfo(2016)) - edit Xtestfile1 - hide edit Xtestfile2 - hide enew - call assert_equal(3, len(getbufinfo({'bufloaded':1}))) - - set tabstop&vim - let b:editor = 'vim' +func Test_getbufwintabinfo() + CheckFeature quickfix + + edit Xtestfile1 + edit Xtestfile2 + let buflist = getbufinfo() + call assert_equal(2, len(buflist)) + call assert_match('Xtestfile1', buflist[0].name) + call assert_match('Xtestfile2', getbufinfo('Xtestfile2')[0].name) + call assert_equal([], getbufinfo(2016)) + edit Xtestfile1 + hide edit Xtestfile2 + hide enew + call assert_equal(3, len(getbufinfo({'bufloaded':1}))) + + set tabstop&vim + let b:editor = 'vim' + let l = getbufinfo('%') + call assert_equal(bufnr('%'), l[0].bufnr) + call assert_equal('vim', l[0].variables.editor) + call assert_notequal(-1, index(l[0].windows, '%'->bufwinid())) + + " Test for getbufinfo() with 'bufmodified' + call assert_equal(0, len(getbufinfo({'bufmodified' : 1}))) + call setbufline('Xtestfile1', 1, ["Line1"]) + let l = getbufinfo({'bufmodified' : 1}) + call assert_equal(1, len(l)) + call assert_equal(bufnr('Xtestfile1'), l[0].bufnr) + + if has('signs') + call append(0, ['Linux', 'Windows', 'Mac']) + sign define Mark text=>> texthl=Search + exe "sign place 2 line=3 name=Mark buffer=" . bufnr('%') let l = getbufinfo('%') - call assert_equal(bufnr('%'), l[0].bufnr) - call assert_equal('vim', l[0].variables.editor) - call assert_notequal(-1, index(l[0].windows, '%'->bufwinid())) - - " Test for getbufinfo() with 'bufmodified' - call assert_equal(0, len(getbufinfo({'bufmodified' : 1}))) - call setbufline('Xtestfile1', 1, ["Line1"]) - let l = getbufinfo({'bufmodified' : 1}) - call assert_equal(1, len(l)) - call assert_equal(bufnr('Xtestfile1'), l[0].bufnr) - - if has('signs') - call append(0, ['Linux', 'Windows', 'Mac']) - sign define Mark text=>> texthl=Search - exe "sign place 2 line=3 name=Mark buffer=" . bufnr('%') - let l = getbufinfo('%') - call assert_equal(2, l[0].signs[0].id) - call assert_equal(3, l[0].signs[0].lnum) - call assert_equal('Mark', l[0].signs[0].name) - sign unplace * - sign undefine Mark - enew! - endif - - only - let w1_id = win_getid() - new - let w2_id = win_getid() - tabnew | let w3_id = win_getid() - new | let w4_id = win_getid() - vert new | let w5_id = win_getid() - eval 'green'->setwinvar(0, 'signal') - tabfirst - let winlist = getwininfo() - call assert_equal(5, len(winlist)) - call assert_equal(winwidth(1), winlist[0].width) - call assert_equal(1, winlist[0].wincol) - " tabline adds one row in terminal, not in GUI - let tablineheight = winlist[0].winrow == 2 ? 1 : 0 - call assert_equal(tablineheight + 1, winlist[0].winrow) - - call assert_equal(winbufnr(2), winlist[1].bufnr) - call assert_equal(winheight(2), winlist[1].height) - call assert_equal(1, winlist[1].wincol) - call assert_equal(tablineheight + winheight(1) + 2, winlist[1].winrow) - - call assert_equal(1, winlist[2].winnr) - call assert_equal(tablineheight + 1, winlist[2].winrow) - call assert_equal(1, winlist[2].wincol) - - call assert_equal(winlist[2].width + 2, winlist[3].wincol) - call assert_equal(1, winlist[4].wincol) - - call assert_equal(1, winlist[0].tabnr) - call assert_equal(1, winlist[1].tabnr) - call assert_equal(2, winlist[2].tabnr) - call assert_equal(2, winlist[3].tabnr) - call assert_equal(2, winlist[4].tabnr) - - call assert_equal('green', winlist[2].variables.signal) - call assert_equal(w4_id, winlist[3].winid) - let winfo = w5_id->getwininfo()[0] - call assert_equal(2, winfo.tabnr) - call assert_equal([], getwininfo(3)) - - call settabvar(1, 'space', 'build') - let tablist = gettabinfo() - call assert_equal(2, len(tablist)) - call assert_equal(3, len(tablist[1].windows)) - call assert_equal(2, tablist[1].tabnr) - call assert_equal('build', tablist[0].variables.space) - call assert_equal(w2_id, tablist[0].windows[0]) - call assert_equal([], 3->gettabinfo()) - - tabonly | only - - lexpr '' - lopen - copen - let winlist = getwininfo() - call assert_false(winlist[0].quickfix) - call assert_false(winlist[0].loclist) - call assert_true(winlist[1].quickfix) - call assert_true(winlist[1].loclist) - call assert_true(winlist[2].quickfix) - call assert_false(winlist[2].loclist) - wincmd t | only -endfunction + call assert_equal(2, l[0].signs[0].id) + call assert_equal(3, l[0].signs[0].lnum) + call assert_equal('Mark', l[0].signs[0].name) + sign unplace * + sign undefine Mark + enew! + endif + + only + let w1_id = win_getid() + new + let w2_id = win_getid() + tabnew | let w3_id = win_getid() + new | let w4_id = win_getid() + vert new | let w5_id = win_getid() + eval 'green'->setwinvar(0, 'signal') + tabfirst + let winlist = getwininfo() + call assert_equal(5, len(winlist)) + call assert_equal(winwidth(1), winlist[0].width) + call assert_equal(1, winlist[0].wincol) + " tabline adds one row in terminal, not in GUI + let tablineheight = winlist[0].winrow == 2 ? 1 : 0 + call assert_equal(tablineheight + 1, winlist[0].winrow) + + call assert_equal(winbufnr(2), winlist[1].bufnr) + call assert_equal(winheight(2), winlist[1].height) + call assert_equal(1, winlist[1].wincol) + call assert_equal(tablineheight + winheight(1) + 2, winlist[1].winrow) + + call assert_equal(1, winlist[2].winnr) + call assert_equal(tablineheight + 1, winlist[2].winrow) + call assert_equal(1, winlist[2].wincol) + + call assert_equal(winlist[2].width + 2, winlist[3].wincol) + call assert_equal(1, winlist[4].wincol) + + call assert_equal(1, winlist[0].tabnr) + call assert_equal(1, winlist[1].tabnr) + call assert_equal(2, winlist[2].tabnr) + call assert_equal(2, winlist[3].tabnr) + call assert_equal(2, winlist[4].tabnr) + + call assert_equal('green', winlist[2].variables.signal) + call assert_equal(w4_id, winlist[3].winid) + let winfo = w5_id->getwininfo()[0] + call assert_equal(2, winfo.tabnr) + call assert_equal([], getwininfo(3)) + + call settabvar(1, 'space', 'build') + let tablist = gettabinfo() + call assert_equal(2, len(tablist)) + call assert_equal(3, len(tablist[1].windows)) + call assert_equal(2, tablist[1].tabnr) + call assert_equal('build', tablist[0].variables.space) + call assert_equal(w2_id, tablist[0].windows[0]) + call assert_equal([], 3->gettabinfo()) + + tabonly | only + + lexpr '' + lopen + copen + let winlist = getwininfo() + call assert_false(winlist[0].quickfix) + call assert_false(winlist[0].loclist) + call assert_true(winlist[1].quickfix) + call assert_true(winlist[1].loclist) + call assert_true(winlist[2].quickfix) + call assert_false(winlist[2].loclist) + wincmd t | only +endfunc function Test_get_buf_options() let opts = bufnr()->getbufvar('&') diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim index b205b9d6f7..5634b98c9f 100644 --- a/src/testdir/test_channel.vim +++ b/src/testdir/test_channel.vim @@ -1548,6 +1548,7 @@ endfunc func Test_write_to_deleted_buffer() CheckExecutable echo + CheckFeature quickfix let job = job_start('echo hello', {'out_io': 'buffer', 'out_name': 'test_buffer', 'out_msg': 0}) let bufnr = bufnr('test_buffer') diff --git a/src/testdir/test_compiler.vim b/src/testdir/test_compiler.vim index 6bb602717f..1ce2718278 100644 --- a/src/testdir/test_compiler.vim +++ b/src/testdir/test_compiler.vim @@ -1,9 +1,12 @@ " Test the :compiler command +source check.vim + func Test_compiler() if !executable('perl') return endif + CheckFeature quickfix " $LANG changes the output of Perl. if $LANG != '' diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim index 07e5dde4b8..4e29e7fe10 100644 --- a/src/testdir/test_edit.vim +++ b/src/testdir/test_edit.vim @@ -982,6 +982,8 @@ func Test_edit_CTRL_V() endfunc func Test_edit_F1() + CheckFeature quickfix + " Pressing <f1> new call feedkeys(":set im\<cr>\<f1>\<c-l>", 'tnix') diff --git a/src/testdir/test_execute_func.vim b/src/testdir/test_execute_func.vim index c2d504fe14..7934e60846 100644 --- a/src/testdir/test_execute_func.vim +++ b/src/testdir/test_execute_func.vim @@ -1,6 +1,7 @@ " test execute() source view_util.vim +source check.vim func NestedEval() let nested = execute('echo "nested\nlines"') @@ -104,6 +105,8 @@ func Test_win_execute() endfunc func Test_win_execute_update_ruler() + CheckFeature quickfix + enew call setline(1, range(500)) 20 diff --git a/src/testdir/test_filter_cmd.vim b/src/testdir/test_filter_cmd.vim index 144c7fa863..543c563bac 100644 --- a/src/testdir/test_filter_cmd.vim +++ b/src/testdir/test_filter_cmd.vim @@ -1,5 +1,7 @@ " Test the :filter command modifier +source check.vim + func Test_filter() edit Xdoesnotmatch edit Xwillmatch @@ -89,6 +91,8 @@ func Test_filter_cmd_with_filter() endfunction func Test_filter_commands() + CheckFeature quickfix + let g:test_filter_a = 1 let b:test_filter_b = 2 let test_filter_c = 3 diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim index 0f2a962304..e3ec4aadfd 100644 --- a/src/testdir/test_gui.vim +++ b/src/testdir/test_gui.vim @@ -722,6 +722,8 @@ func Test_scrollbars() endfunc func Test_menu() + CheckFeature quickfix + " Check Help menu exists let help_menu = execute('menu Help') call assert_match('Overview', help_menu) diff --git a/src/testdir/test_makeencoding.vim b/src/testdir/test_makeencoding.vim index 09d36eac9a..55b2995353 100644 --- a/src/testdir/test_makeencoding.vim +++ b/src/testdir/test_makeencoding.vim @@ -1,7 +1,9 @@ " Tests for 'makeencoding'. source shared.vim +source check.vim +CheckFeature quickfix let s:python = PythonProg() if s:python == '' throw 'Skipped: python program missing' diff --git a/src/testdir/test_mksession.vim b/src/testdir/test_mksession.vim index a3712a37dd..dac7c54731 100644 --- a/src/testdir/test_mksession.vim +++ b/src/testdir/test_mksession.vim @@ -355,6 +355,8 @@ endfunc if has('terminal') func Test_mksession_terminal_shell() + CheckFeature quickfix + terminal mksession! Xtest_mks.out let lines = readfile('Xtest_mks.out') @@ -436,6 +438,8 @@ func Test_mksession_terminal_no_ssop() endfunc func Test_mksession_terminal_restore_other() + CheckFeature quickfix + terminal eval bufnr('%')->term_setrestore('other') mksession! Xtest_mks.out diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim index a28a82540a..d45cf41592 100644 --- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -1,6 +1,7 @@ " Test for various Normal mode commands source shared.vim +source check.vim func Setup_NewWindow() 10new @@ -1240,6 +1241,8 @@ func Test_normal24_rot13() endfunc func Test_normal25_tag() + CheckFeature quickfix + " Testing for CTRL-] g CTRL-] g] " CTRL-W g] CTRL-W CTRL-] CTRL-W g CTRL-] h diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim index 21bd22ade2..5922efa0e4 100644 --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -490,6 +490,8 @@ endfunc " Test that 'completefunc' on Scratch buffer with preview window works when " it's OK. func Test_completefunc_with_scratch_buffer() + CheckFeature quickfix + new +setlocal\ buftype=nofile\ bufhidden=wipe\ noswapfile set completeopt+=preview setlocal completefunc=DummyCompleteFive @@ -665,6 +667,7 @@ endfunc func Test_popup_and_window_resize() CheckFeature terminal + CheckFeature quickfix CheckNotGui let h = winheight(0) @@ -697,14 +700,13 @@ func Test_popup_and_window_resize() endfunc func Test_popup_and_preview_autocommand() - " This used to crash Vim - if !has('python') - return - endif - let h = winheight(0) - if h < 15 - return + CheckFeature python + CheckFeature quickfix + if winheight(0) < 15 + throw 'Skipped: window height insufficient' endif + + " This used to crash Vim new augroup MyBufAdd au! @@ -735,9 +737,9 @@ func Test_popup_and_preview_autocommand() endfunc func Test_popup_and_previewwindow_dump() - if !CanRunVimInTerminal() - throw 'Skipped: cannot make screendumps' - endif + CheckScreendump + CheckFeature quickfix + let lines =<< trim END set previewheight=9 silent! pedit @@ -804,9 +806,8 @@ func Test_balloon_split() endfunc func Test_popup_position() - if !CanRunVimInTerminal() - throw 'Skipped: cannot make screendumps' - endif + CheckScreendump + let lines =<< trim END 123456789_123456789_123456789_a 123456789_123456789_123456789_b @@ -847,9 +848,8 @@ func Test_popup_position() endfunc func Test_popup_command() - if !CanRunVimInTerminal() || !has('menu') - throw 'Skipped: cannot make screendumps and/or menu feature missing' - endif + CheckScreendump + CheckFeature menu let lines =<< trim END one two three four five diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim index 9ecd2459a1..6bfc6dd43a 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -2700,6 +2700,7 @@ endfunc func Test_previewpopup() CheckScreendump + CheckFeature quickfix call writefile([ \ "!_TAG_FILE_ENCODING\tutf-8\t//", @@ -2871,6 +2872,7 @@ endfunc func Test_popupmenu_info_border() CheckScreendump + CheckFeature quickfix let lines = Get_popupmenu_lines() call add(lines, 'set completepopup=height:4,highlight:InfoPopup') @@ -2908,6 +2910,7 @@ endfunc func Test_popupmenu_info_noborder() CheckScreendump + CheckFeature quickfix let lines = Get_popupmenu_lines() call add(lines, 'set completepopup=height:4,border:off') @@ -2925,6 +2928,7 @@ endfunc func Test_popupmenu_info_align_menu() CheckScreendump + CheckFeature quickfix let lines = Get_popupmenu_lines() call add(lines, 'set completepopup=height:4,border:off,align:menu') @@ -2955,6 +2959,7 @@ endfunc func Test_popupmenu_info_hidden() CheckScreendump + CheckFeature quickfix let lines = Get_popupmenu_lines() call add(lines, 'call InfoHidden()') diff --git a/src/testdir/test_preview.vim b/src/testdir/test_preview.vim index 91923fb1e9..a85798bab3 100644 --- a/src/testdir/test_preview.vim +++ b/src/testdir/test_preview.vim @@ -1,4 +1,6 @@ " Tests for the preview window +source check.vim +CheckFeature quickfix func Test_Psearch() " this used to cause ml_get errors diff --git a/src/testdir/test_startup.vim b/src/testdir/test_startup.vim index 358ca81718..1617c5243a 100644 --- a/src/testdir/test_startup.vim +++ b/src/testdir/test_startup.vim @@ -279,6 +279,8 @@ endfunc " Test the '-q [errorfile]' argument. func Test_q_arg() + CheckFeature quickfix + let source_file = has('win32') ? '..\memfile.c' : '../memfile.c' let after =<< trim [CODE] call writefile([&errorfile, string(getpos("."))], "Xtestout") @@ -458,14 +460,16 @@ func Test_invalid_args() call assert_equal('Too many edit arguments: "xxx"', out[1]) call assert_equal('More info with: "vim -h"', out[2]) - " Detect invalid repeated arguments '-t foo -t foo", '-q foo -q foo'. - for opt in ['-t', '-q'] - let out = split(system(GetVimCommand() .. repeat(' ' .. opt .. ' foo', 2)), "\n") - call assert_equal(1, v:shell_error) - call assert_match('^VIM - Vi IMproved .* (.*)$', out[0]) - call assert_equal('Too many edit arguments: "' .. opt .. '"', out[1]) - call assert_equal('More info with: "vim -h"', out[2]) - endfor + if has('quickfix') + " Detect invalid repeated arguments '-t foo -t foo", '-q foo -q foo'. + for opt in ['-t', '-q'] + let out = split(system(GetVimCommand() .. repeat(' ' .. opt .. ' foo', 2)), "\n") + call assert_equal(1, v:shell_error) + call assert_match('^VIM - Vi IMproved .* (.*)$', out[0]) + call assert_equal('Too many edit arguments: "' .. opt .. '"', out[1]) + call assert_equal('More info with: "vim -h"', out[2]) + endfor + endif for opt in [' -cq', ' --cmd q', ' +', ' -S foo'] let out = split(system(GetVimCommand() .. repeat(opt, 11)), "\n") diff --git a/src/testdir/test_statusline.vim b/src/testdir/test_statusline.vim index af05be58e1..1f705b847f 100644 --- a/src/testdir/test_statusline.vim +++ b/src/testdir/test_statusline.vim @@ -7,6 +7,7 @@ " %X source view_util.vim +source check.vim func s:get_statusline() return ScreenLines(&lines - 1, &columns)[0] @@ -60,6 +61,8 @@ func Test_statusline_will_be_disabled_with_error() endfunc func Test_statusline() + CheckFeature quickfix + new Xstatusline only set laststatus=2 diff --git a/src/testdir/test_tabpage.vim b/src/testdir/test_tabpage.vim index 020fe27659..392eecbf79 100644 --- a/src/testdir/test_tabpage.vim +++ b/src/testdir/test_tabpage.vim @@ -1,8 +1,11 @@ " Tests for tabpage source screendump.vim +source check.vim function Test_tabpage() + CheckFeature quickfix + bw! " Simple test for opening and closing a tab page tabnew @@ -220,6 +223,8 @@ function Test_tabpage_with_autocmd() endfunction function Test_tabpage_with_tab_modifier() + CheckFeature quickfix + for n in range(4) tabedit endfor diff --git a/src/testdir/test_tagjump.vim b/src/testdir/test_tagjump.vim index 14c99036d1..14ba1f78dd 100644 --- a/src/testdir/test_tagjump.vim +++ b/src/testdir/test_tagjump.vim @@ -5,12 +5,16 @@ source screendump.vim " SEGV occurs in older versions. (At least 7.4.1748 or older) func Test_ptag_with_notagstack() + CheckFeature quickfix + set notagstack call assert_fails('ptag does_not_exist_tag_name', 'E426') set tagstack&vim endfunc func Test_cancel_ptjump() + CheckFeature quickfix + set tags=Xtags call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", \ "word\tfile1\tcmd1", @@ -70,6 +74,8 @@ func Test_duplicate_tagjump() endfunc func Test_tagjump_switchbuf() + CheckFeature quickfix + set tags=Xtags call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", \ "second\tXfile1\t2", diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim index d958c36973..d543ef7e63 100644 --- a/src/testdir/test_window_cmd.vim +++ b/src/testdir/test_window_cmd.vim @@ -175,6 +175,8 @@ func Test_window_split_edit_bufnr() endfunc func Test_window_preview() + CheckFeature quickfix + " Open a preview window pedit Xa call assert_equal(2, winnr('$')) @@ -193,6 +195,8 @@ func Test_window_preview() endfunc func Test_window_preview_from_help() + CheckFeature quickfix + filetype on call writefile(['/* some C code */'], 'Xpreview.c') help @@ -438,6 +442,8 @@ func Test_equalalways_on_close() endfunc func Test_win_screenpos() + CheckFeature quickfix + call assert_equal(1, winnr('$')) split vsplit @@ -451,6 +457,8 @@ func Test_win_screenpos() endfunc func Test_window_jump_tag() + CheckFeature quickfix + help /iccf call assert_match('^|iccf|', getline('.')) @@ -887,6 +895,8 @@ func Test_winrestview() endfunc func Test_win_splitmove() + CheckFeature quickfix + edit a leftabove split b leftabove vsplit c diff --git a/src/testdir/test_window_id.vim b/src/testdir/test_window_id.vim index 8bf4ede350..9c92faeea5 100644 --- a/src/testdir/test_window_id.vim +++ b/src/testdir/test_window_id.vim @@ -1,4 +1,5 @@ " Test using the window ID. +source check.vim func Test_win_getid() edit one @@ -94,6 +95,8 @@ func Test_win_getid() endfunc |