To: vim_dev@googlegroups.com Subject: Patch 8.1.1837 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.1837 Problem: Popup test fails if clipboard is supported but not working. Solution: Add the "clipboard_working" feature. Also use Check commands instead of "if" and "throw". And remove stray ch_logfile(). Files: src/testdir/test_popupwin.vim, src/evalfunc.c, runtime/doc/eval.txt *** ../vim-8.1.1836/src/testdir/test_popupwin.vim 2019-08-05 21:51:36.801568843 +0200 --- src/testdir/test_popupwin.vim 2019-08-10 22:16:42.550570362 +0200 *************** *** 6,14 **** source screendump.vim func Test_simple_popup() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let lines =<< trim END call setline(1, range(1, 100)) hi PopupColor1 ctermbg=lightblue --- 6,13 ---- source screendump.vim func Test_simple_popup() ! CheckScreendump ! let lines =<< trim END call setline(1, range(1, 100)) hi PopupColor1 ctermbg=lightblue *************** *** 77,85 **** endfunc func Test_popup_with_border_and_padding() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif for iter in range(0, 1) let lines =<< trim END --- 76,82 ---- endfunc func Test_popup_with_border_and_padding() ! CheckScreendump for iter in range(0, 1) let lines =<< trim END *************** *** 191,199 **** endfunc func Test_popup_with_syntax_win_execute() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let lines =<< trim END call setline(1, range(1, 100)) hi PopupColor ctermbg=lightblue --- 188,195 ---- endfunc func Test_popup_with_syntax_win_execute() ! CheckScreendump ! let lines =<< trim END call setline(1, range(1, 100)) hi PopupColor ctermbg=lightblue *************** *** 216,224 **** endfunc func Test_popup_with_syntax_setbufvar() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let lines =<< trim END call setline(1, range(1, 100)) hi PopupColor ctermbg=lightgrey --- 212,219 ---- endfunc func Test_popup_with_syntax_setbufvar() ! CheckScreendump ! let lines =<< trim END call setline(1, range(1, 100)) hi PopupColor ctermbg=lightgrey *************** *** 241,249 **** endfunc func Test_popup_with_matches() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let lines =<< trim END call setline(1, ['111 222 333', '444 555 666']) let winid = popup_create([ --- 236,243 ---- endfunc func Test_popup_with_matches() ! CheckScreendump ! let lines =<< trim END call setline(1, ['111 222 333', '444 555 666']) let winid = popup_create([ *************** *** 267,275 **** endfunc func Test_popup_all_corners() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let lines =<< trim END call setline(1, repeat([repeat('-', 60)], 15)) set so=0 --- 261,268 ---- endfunc func Test_popup_all_corners() ! CheckScreendump ! let lines =<< trim END call setline(1, repeat([repeat('-', 60)], 15)) set so=0 *************** *** 316,324 **** endfunc func Test_popup_firstline() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let lines =<< trim END call setline(1, range(1, 20)) call popup_create(['1111', '222222', '33333', '44', '5', '666666', '77777', '888', '9999999999999999'], #{ --- 309,316 ---- endfunc func Test_popup_firstline() ! CheckScreendump ! let lines =<< trim END call setline(1, range(1, 20)) call popup_create(['1111', '222222', '33333', '44', '5', '666666', '77777', '888', '9999999999999999'], #{ *************** *** 346,354 **** endfunc func Test_popup_drag() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif " create a popup that covers the command line let lines =<< trim END call setline(1, range(1, 20)) --- 338,345 ---- endfunc func Test_popup_drag() ! CheckScreendump ! " create a popup that covers the command line let lines =<< trim END call setline(1, range(1, 20)) *************** *** 385,393 **** endfunc func Test_popup_close_with_mouse() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let lines =<< trim END call setline(1, range(1, 20)) " With border, can click on X --- 376,383 ---- endfunc func Test_popup_close_with_mouse() ! CheckScreendump ! let lines =<< trim END call setline(1, range(1, 20)) " With border, can click on X *************** *** 442,450 **** endfunction func Test_popup_with_mask() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let lines =<< trim END call setline(1, repeat([join(range(1, 42), '')], 13)) hi PopupColor ctermbg=lightgrey --- 432,439 ---- endfunction func Test_popup_with_mask() ! CheckScreendump ! let lines =<< trim END call setline(1, repeat([join(range(1, 42), '')], 13)) hi PopupColor ctermbg=lightgrey *************** *** 510,521 **** endfunc func Test_popup_select() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif ! if !has('clipboard') ! throw 'Skipped: clipboard feature missing' ! endif " create a popup with some text to be selected let lines =<< trim END set clipboard=autoselect --- 499,507 ---- endfunc func Test_popup_select() ! CheckScreendump ! CheckFeature clipboard_working ! " create a popup with some text to be selected let lines =<< trim END set clipboard=autoselect *************** *** 690,698 **** endfunc func Test_popup_with_wrap() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let lines =<< trim END call setline(1, range(1, 100)) let winid = popup_create( --- 676,683 ---- endfunc func Test_popup_with_wrap() ! CheckScreendump ! let lines =<< trim END call setline(1, range(1, 100)) let winid = popup_create( *************** *** 709,717 **** endfunc func Test_popup_without_wrap() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let lines =<< trim END call setline(1, range(1, 100)) let winid = popup_create( --- 694,701 ---- endfunc func Test_popup_without_wrap() ! CheckScreendump ! let lines =<< trim END call setline(1, range(1, 100)) let winid = popup_create( *************** *** 728,736 **** endfunc func Test_popup_with_showbreak() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let lines =<< trim END set showbreak=>>\ call setline(1, range(1, 20)) --- 712,719 ---- endfunc func Test_popup_with_showbreak() ! CheckScreendump ! let lines =<< trim END set showbreak=>>\ call setline(1, range(1, 20)) *************** *** 749,757 **** endfunc func Test_popup_time() ! if !has('timers') ! throw 'Skipped: timer feature not supported' ! endif topleft vnew call setline(1, 'hello') --- 732,739 ---- endfunc func Test_popup_time() ! CheckFeature timers ! topleft vnew call setline(1, 'hello') *************** *** 1070,1078 **** endfunc func Test_popup_beval() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let lines =<< trim END call setline(1, range(1, 20)) --- 1052,1058 ---- endfunc func Test_popup_beval() ! CheckScreendump let lines =<< trim END call setline(1, range(1, 20)) *************** *** 1223,1231 **** endfunc func Test_popup_menu_screenshot() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let lines =<< trim END call setline(1, range(1, 20)) --- 1203,1209 ---- endfunc func Test_popup_menu_screenshot() ! CheckScreendump let lines =<< trim END call setline(1, range(1, 20)) *************** *** 1251,1259 **** endfunc func Test_popup_menu_narrow() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let lines =<< trim END call setline(1, range(1, 20)) --- 1229,1235 ---- endfunc func Test_popup_menu_narrow() ! CheckScreendump let lines =<< trim END call setline(1, range(1, 20)) *************** *** 1274,1282 **** endfunc func Test_popup_title() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif " Create a popup without title or border, a line of padding will be added to " put the title on. --- 1250,1256 ---- endfunc func Test_popup_title() ! CheckScreendump " Create a popup without title or border, a line of padding will be added to " put the title on. *************** *** 1333,1341 **** endfunc func Test_popup_never_behind() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif " +-----------------------------+ " | | | " | | | --- 1307,1314 ---- endfunc func Test_popup_never_behind() ! CheckScreendump ! " +-----------------------------+ " | | | " | | | *************** *** 1616,1627 **** endfunc func Test_notifications() ! if !has('timers') ! throw 'Skipped: timer feature not supported' ! endif ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif call writefile([ \ "call setline(1, range(1, 20))", --- 1589,1596 ---- endfunc func Test_notifications() ! CheckFeature timers ! CheckScreendump call writefile([ \ "call setline(1, range(1, 20))", *************** *** 1642,1650 **** endfunc func Test_popup_scrollbar() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let lines =<< trim END call setline(1, range(1, 20)) --- 1611,1617 ---- endfunc func Test_popup_scrollbar() ! CheckScreendump let lines =<< trim END call setline(1, range(1, 20)) *************** *** 1727,1735 **** endfunc func Test_popup_settext() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let lines =<< trim END let opts = #{wrap: 0} --- 1694,1700 ---- endfunc func Test_popup_settext() ! CheckScreendump let lines =<< trim END let opts = #{wrap: 0} *************** *** 1901,1909 **** endfunc func Test_popup_menu_with_maxwidth() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let lines =<< trim END call setline(1, range(1, 10)) --- 1866,1872 ---- endfunc func Test_popup_menu_with_maxwidth() ! CheckScreendump let lines =<< trim END call setline(1, range(1, 10)) *************** *** 1942,1950 **** endfunc func Test_popup_menu_with_scrollbar() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let lines =<< trim END call setline(1, range(1, 20)) --- 1905,1911 ---- endfunc func Test_popup_menu_with_scrollbar() ! CheckScreendump let lines =<< trim END call setline(1, range(1, 20)) *************** *** 1988,1996 **** endfunc func Test_popup_menu_filter() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let lines =<< trim END function! MyFilter(winid, key) abort --- 1949,1955 ---- endfunc func Test_popup_menu_filter() ! CheckScreendump let lines =<< trim END function! MyFilter(winid, key) abort *************** *** 2044,2052 **** endfunc func Test_popup_cursorline() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif let winid = popup_create('some text', {}) call assert_equal(0, popup_getoptions(winid).cursorline) --- 2003,2009 ---- endfunc func Test_popup_cursorline() ! CheckScreendump let winid = popup_create('some text', {}) call assert_equal(0, popup_getoptions(winid).cursorline) *************** *** 2160,2168 **** endfunc func Test_previewpopup() ! if !CanRunVimInTerminal() ! throw 'Skipped: cannot make screendumps' ! endif call writefile([ \ "!_TAG_FILE_ENCODING\tutf-8\t//", \ "another\tXtagfile\t/^this is another", --- 2117,2124 ---- endfunc func Test_previewpopup() ! CheckScreendump ! call writefile([ \ "!_TAG_FILE_ENCODING\tutf-8\t//", \ "another\tXtagfile\t/^this is another", *************** *** 2194,2201 **** \ 'very long line where the word is also another']) set previewpopup=height:4,width:40 set path=. - call ch_logfile('logfile', 'w') - call ch_log('logfile started') END call writefile(lines, 'XtestPreviewPopup') let buf = RunVimInTerminal('-S XtestPreviewPopup', #{rows: 14}) --- 2150,2155 ---- *** ../vim-8.1.1836/src/evalfunc.c 2019-08-10 00:13:24.712826628 +0200 --- src/evalfunc.c 2019-08-10 22:13:05.706939164 +0200 *************** *** 6629,6634 **** --- 6629,6638 ---- else if (STRICMP(name, "conpty") == 0) n = use_conpty(); #endif + #ifdef FEAT_CLIPBOARD + else if (STRICMP(name, "clipboard_working") == 0) + n = clip_star.available; + #endif } rettv->vval.v_number = n; *** ../vim-8.1.1836/runtime/doc/eval.txt 2019-08-10 00:13:24.712826628 +0200 --- runtime/doc/eval.txt 2019-08-10 22:15:28.818719709 +0200 *************** *** 9582,9587 **** --- 9607,9613 ---- cindent Compiled with 'cindent' support. clientserver Compiled with remote invocation support |clientserver|. clipboard Compiled with 'clipboard' support. + clipboard_working Compiled with 'clipboard' support and it can be used. cmdline_compl Compiled with |cmdline-completion| support. cmdline_hist Compiled with |cmdline-history| support. cmdline_info Compiled with 'showcmd' and 'ruler' support. *** ../vim-8.1.1836/src/version.c 2019-08-10 14:54:16.778279055 +0200 --- src/version.c 2019-08-10 22:15:49.270680498 +0200 *************** *** 771,772 **** --- 771,774 ---- { /* Add new patch number below this line */ + /**/ + 1837, /**/ -- Never overestimate a man's ability to underestimate a woman. /// Bram Moolenaar -- Bram@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 ///