Skip to content

Commit 17471e8

Browse files
committed
patch 8.0.1349: options test fails when using Motif or GTK GUI
Problem: Options test fails when using Motif or GTK GUI. Solution: Use "fixed" instead of "fixedsys" for Unix. Don't try "xxx" for guifonteset. Don't set 'termencoding' to anything but "utf-8" for GTK. Give an error if 'termencoding' can't be converted.
1 parent c8c7579 commit 17471e8

3 files changed

Lines changed: 21 additions & 6 deletions

File tree

src/option.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6369,8 +6369,13 @@ did_set_string_option(
63696369
* display output conversion. */
63706370
if (((varp == &p_enc && *p_tenc != NUL) || varp == &p_tenc))
63716371
{
6372-
convert_setup(&input_conv, p_tenc, p_enc);
6373-
convert_setup(&output_conv, p_enc, p_tenc);
6372+
if (convert_setup(&input_conv, p_tenc, p_enc) == FAIL
6373+
|| convert_setup(&output_conv, p_enc, p_tenc) == FAIL)
6374+
{
6375+
EMSG3(_("E950: Cannot convert between %s and %s"),
6376+
p_tenc, p_enc);
6377+
errmsg = e_invarg;
6378+
}
63746379
}
63756380

63766381
# if defined(WIN3264) && defined(FEAT_MBYTE)

src/testdir/gen_opt_test.vim

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ let script = [
1919
/#define p_term
2020
let end = line('.')
2121

22+
" font name that works everywhere (hopefully)
23+
let fontname = has('win32') ? 'fixedsys' : 'fixed'
24+
2225
" Two lists with values: values that work and values that fail.
2326
" When not listed, "othernum" or "otherstring" is used.
2427
let test_values = {
@@ -93,8 +96,9 @@ let test_values = {
9396
\ 'foldmarker': [['((,))'], ['', 'xxx']],
9497
\ 'formatoptions': [['', 'vt', 'v,t'], ['xxx']],
9598
\ 'guicursor': [['', 'n:block-Cursor'], ['xxx']],
96-
\ 'guifont': [['', 'fixedsys'], []],
97-
\ 'guifontwide': [['', 'fixedsys'], []],
99+
\ 'guifont': [['', fontname], []],
100+
\ 'guifontwide': [['', fontname], []],
101+
\ 'guifontset': [['', fontname], []],
98102
\ 'helplang': [['', 'de', 'de,it'], ['xxx']],
99103
\ 'highlight': [['', 'e:Error'], ['xxx']],
100104
\ 'imactivatekey': [['', 'S-space'], ['xxx']],
@@ -126,6 +130,7 @@ let test_values = {
126130
\ 'tagcase': [['smart', 'match'], ['', 'xxx', 'smart,match']],
127131
\ 'term': [[], []],
128132
\ 'termsize': [['', '24x80', '0x80', '32x0', '0x0'], ['xxx', '80', '8ax9', '24x80b']],
133+
\ 'termencoding': [has('gui_gtk') ? [] : ['', 'utf-8'], ['xxx']],
129134
\ 'toolbar': [['', 'icons', 'text'], ['xxx']],
130135
\ 'toolbariconsize': [['', 'tiny', 'huge'], ['xxx']],
131136
\ 'ttymouse': [['', 'xterm'], ['xxx']],
@@ -189,8 +194,11 @@ while 1
189194
call add(script, "endif")
190195
endif
191196

192-
call add(script, 'set ' . name . '&')
193-
call add(script, 'set ' . shortname . '&')
197+
" cannot change 'termencoding' in GTK
198+
if name != 'termencoding' || !has('gui_gtk')
199+
call add(script, 'set ' . name . '&')
200+
call add(script, 'set ' . shortname . '&')
201+
endif
194202
if name == 'verbosefile'
195203
call add(script, 'call delete("xxx")')
196204
endif

src/version.c

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

772772
static int included_patches[] =
773773
{ /* Add new patch number below this line */
774+
/**/
775+
1349,
774776
/**/
775777
1348,
776778
/**/

0 commit comments

Comments
 (0)