Patch 8.2.2611

5 views
Skip to first unread message

Bram Moolenaar

unread,
Mar 17, 2021, 7:28:07 AM3/17/21
to vim...@googlegroups.com

Patch 8.2.2611
Problem: Conditions for startup tests are not exactly right.
Solution: Check for type of GUI instead of MS-Windows. (Ozaki Kiichi,
closes #7976)
Files: src/main.c, src/testdir/check.vim, src/testdir/test_startup.vim


*** ../vim-8.2.2610/src/main.c 2021-02-11 19:18:54.274296667 +0100
--- src/main.c 2021-03-17 12:20:10.940423313 +0100
***************
*** 3542,3549 ****
--- 3542,3552 ----
#endif // FEAT_GUI_X11
#ifdef FEAT_GUI_GTK
mch_msg(_("\nArguments recognised by gvim (GTK+ version):\n"));
+ main_msg(_("-background <color>\tUse <color> for the background (also: -bg)"));
+ main_msg(_("-foreground <color>\tUse <color> for normal text (also: -fg)"));
main_msg(_("-font <font>\t\tUse <font> for normal text (also: -fn)"));
main_msg(_("-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"));
+ main_msg(_("-iconic\t\tStart Vim iconified"));
main_msg(_("-reverse\t\tUse reverse video (also: -rv)"));
main_msg(_("-display <display>\tRun Vim on <display> (also: --display)"));
main_msg(_("--role <role>\tSet a unique role to identify the main window"));
*** ../vim-8.2.2610/src/testdir/check.vim 2021-03-10 21:46:35.498399355 +0100
--- src/testdir/check.vim 2021-03-17 12:23:32.663985624 +0100
***************
*** 199,202 ****
--- 199,227 ----
endif
endfunc

+ " Command to check for satisfying any of the conditions.
+ " e.g. CheckAnyOf Feature:bsd Feature:sun Linux
+ command -nargs=+ CheckAnyOf call CheckAnyOf(<f-args>)
+ func CheckAnyOf(...)
+ let excp = []
+ for arg in a:000
+ try
+ exe 'Check' .. substitute(arg, ':', ' ', '')
+ return
+ catch /^Skipped:/
+ let excp += [substitute(v:exception, '^Skipped:\s*', '', '')]
+ endtry
+ endfor
+ throw 'Skipped: ' .. join(excp, '; ')
+ endfunc
+
+ " Command to check for satisfying all of the conditions.
+ " e.g. CheckAllOf Unix Gui Option:ballooneval
+ command -nargs=+ CheckAllOf call CheckAllOf(<f-args>)
+ func CheckAllOf(...)
+ for arg in a:000
+ exe 'Check' .. substitute(arg, ':', ' ', '')
+ endfor
+ endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.2610/src/testdir/test_startup.vim 2021-03-16 13:23:26.972508898 +0100
--- src/testdir/test_startup.vim 2021-03-17 12:26:31.203587336 +0100
***************
*** 109,117 ****
endfunc

func Test_help_arg()
! if !has('unix') && has('gui_running')
! throw 'Skipped: does not work with gvim on MS-Windows'
! endif

if RunVim([], [], '--help >Xtestout')
let lines = readfile('Xtestout')
--- 109,116 ----
endfunc

func Test_help_arg()
! " This does not work with a GUI-only binary, such as on MS-Windows.
! CheckAnyOf Unix NotGui

if RunVim([], [], '--help >Xtestout')
let lines = readfile('Xtestout')
***************
*** 426,432 ****
" Test the -reverse and +reverse arguments (for GUI only).
func Test_reverse()
CheckCanRunGui
! CheckNotMSWindows

let after =<< trim [CODE]
call writefile([&background], "Xtest_reverse")
--- 425,431 ----
" Test the -reverse and +reverse arguments (for GUI only).
func Test_reverse()
CheckCanRunGui
! CheckAnyOf Feature:gui_gtk Feature:gui_motif Feature:gui_athena

let after =<< trim [CODE]
call writefile([&background], "Xtest_reverse")
***************
*** 447,453 ****
" Test the -background and -foreground arguments (for GUI only).
func Test_background_foreground()
CheckCanRunGui
! CheckNotMSWindows

" Is there a better way to check the effect of -background & -foreground
" other than merely looking at &background (dark or light)?
--- 446,452 ----
" Test the -background and -foreground arguments (for GUI only).
func Test_background_foreground()
CheckCanRunGui
! CheckAnyOf Feature:gui_gtk Feature:gui_motif Feature:gui_athena

" Is there a better way to check the effect of -background & -foreground
" other than merely looking at &background (dark or light)?
***************
*** 496,502 ****
" Test the -geometry argument (for GUI only).
func Test_geometry()
CheckCanRunGui
! CheckNotMSWindows

if has('gui_motif') || has('gui_athena')
" FIXME: With GUI Athena or Motif, the value of getwinposx(),
--- 495,501 ----
" Test the -geometry argument (for GUI only).
func Test_geometry()
CheckCanRunGui
! CheckAnyOf Feature:gui_gtk Feature:gui_motif Feature:gui_athena

if has('gui_motif') || has('gui_athena')
" FIXME: With GUI Athena or Motif, the value of getwinposx(),
***************
*** 528,534 ****
" Test the -iconic argument (for GUI only).
func Test_iconic()
CheckCanRunGui
! CheckNotMSWindows

call RunVim([], [], '-f -g -iconic -cq')

--- 527,533 ----
" Test the -iconic argument (for GUI only).
func Test_iconic()
CheckCanRunGui
! CheckAnyOf Feature:gui_gtk Feature:gui_motif Feature:gui_athena

call RunVim([], [], '-f -g -iconic -cq')

*** ../vim-8.2.2610/src/version.c 2021-03-16 21:17:12.249245839 +0100
--- src/version.c 2021-03-17 12:21:44.480222291 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2611,
/**/

--
Engineers will go without food and hygiene for days to solve a problem.
(Other times just because they forgot.)
(Scott Adams - The Dilbert principle)

/// 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 ///
Reply all
Reply to author
Forward
0 new messages