Skip to content

Commit f8ab1b1

Browse files
committed
patch 8.0.0395: testing the + register fails with Motif
Problem: Testing the + register fails with Motif. Solution: Also ignore the "failed to create input context" error in the second gvim. Don't use msg() when it would result in a dialog.
1 parent abc39ab commit f8ab1b1

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

src/message.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,8 @@ emsg(char_u *s)
605605
#ifdef FEAT_EVAL
606606
/* When testing some errors are turned into a normal message. */
607607
if (ignore_error(s))
608-
return msg(s);
608+
/* don't call msg() if it results in a dialog */
609+
return msg_use_printf() ? FALSE : msg(s);
609610
#endif
610611

611612
called_emsg = TRUE;

src/testdir/setup_gui.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ endfunc
2727
func GUITearDownCommon()
2828
call delete('Xhome', 'rf')
2929
endfunc
30+
31+
" Ignore the "failed to create input context" error.
32+
call test_ignore_error('E285')

src/testdir/test_gui.vim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ endfunc
1717
" Test for resetting "secure" flag after GUI has started.
1818
" Must be run first.
1919
func Test_1_set_secure()
20-
" Ignore the "failed to create input context" error.
21-
call test_ignore_error('E285')
22-
2320
set exrc secure
2421
gui -f
2522
call assert_equal(1, has('gui_running'))
@@ -87,13 +84,16 @@ func Test_quoteplus()
8784
let test_response = 'Yes, I can.'
8885
let vim_exe = exepath(v:progpath)
8986
let testee = 'VIMRUNTIME=' . $VIMRUNTIME . '; export VIMRUNTIME;'
90-
\ . vim_exe . ' -f -g -u NONE -U NONE --noplugin -c ''%s'''
91-
let cmd = 'call feedkeys("'
87+
\ . vim_exe
88+
\ . ' -f -g -u NONE -U NONE --noplugin --cmd ''%s'' -c ''%s'''
89+
" Ignore the "failed to create input context" error.
90+
let cmd1 = 'call test_ignore_error("E285")'
91+
let cmd2 = 'call feedkeys("'
9292
\ . '\"+p'
9393
\ . ':s/' . test_call . '/' . test_response . '/\<CR>'
9494
\ . '\"+yis'
9595
\ . ':q!\<CR>", "tx")'
96-
let run_vimtest = printf(testee, cmd)
96+
let run_vimtest = printf(testee, cmd1, cmd2)
9797

9898
" Set the quoteplus register to test_call, and another gvim will launched.
9999
" Then, it first tries to paste the content of its own quotedplus register

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
395,
767769
/**/
768770
394,
769771
/**/

0 commit comments

Comments
 (0)