summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/option.c9
-rw-r--r--src/testdir/gen_opt_test.vim16
-rw-r--r--src/version.c2
3 files changed, 21 insertions, 6 deletions
diff --git a/src/option.c b/src/option.c
index a86760860..c97056bde 100644
--- a/src/option.c
+++ b/src/option.c
@@ -6369,8 +6369,13 @@ did_set_string_option(
* display output conversion. */
if (((varp == &p_enc && *p_tenc != NUL) || varp == &p_tenc))
{
- convert_setup(&input_conv, p_tenc, p_enc);
- convert_setup(&output_conv, p_enc, p_tenc);
+ if (convert_setup(&input_conv, p_tenc, p_enc) == FAIL
+ || convert_setup(&output_conv, p_enc, p_tenc) == FAIL)
+ {
+ EMSG3(_("E950: Cannot convert between %s and %s"),
+ p_tenc, p_enc);
+ errmsg = e_invarg;
+ }
}
# if defined(WIN3264) && defined(FEAT_MBYTE)
diff --git a/src/testdir/gen_opt_test.vim b/src/testdir/gen_opt_test.vim
index 32283c99b..4edf44aaf 100644
--- a/src/testdir/gen_opt_test.vim
+++ b/src/testdir/gen_opt_test.vim
@@ -19,6 +19,9 @@ let script = [
/#define p_term
let end = line('.')
+" font name that works everywhere (hopefully)
+let fontname = has('win32') ? 'fixedsys' : 'fixed'
+
" Two lists with values: values that work and values that fail.
" When not listed, "othernum" or "otherstring" is used.
let test_values = {
@@ -93,8 +96,9 @@ let test_values = {
\ 'foldmarker': [['((,))'], ['', 'xxx']],
\ 'formatoptions': [['', 'vt', 'v,t'], ['xxx']],
\ 'guicursor': [['', 'n:block-Cursor'], ['xxx']],
- \ 'guifont': [['', 'fixedsys'], []],
- \ 'guifontwide': [['', 'fixedsys'], []],
+ \ 'guifont': [['', fontname], []],
+ \ 'guifontwide': [['', fontname], []],
+ \ 'guifontset': [['', fontname], []],
\ 'helplang': [['', 'de', 'de,it'], ['xxx']],
\ 'highlight': [['', 'e:Error'], ['xxx']],
\ 'imactivatekey': [['', 'S-space'], ['xxx']],
@@ -126,6 +130,7 @@ let test_values = {
\ 'tagcase': [['smart', 'match'], ['', 'xxx', 'smart,match']],
\ 'term': [[], []],
\ 'termsize': [['', '24x80', '0x80', '32x0', '0x0'], ['xxx', '80', '8ax9', '24x80b']],
+ \ 'termencoding': [has('gui_gtk') ? [] : ['', 'utf-8'], ['xxx']],
\ 'toolbar': [['', 'icons', 'text'], ['xxx']],
\ 'toolbariconsize': [['', 'tiny', 'huge'], ['xxx']],
\ 'ttymouse': [['', 'xterm'], ['xxx']],
@@ -189,8 +194,11 @@ while 1
call add(script, "endif")
endif
- call add(script, 'set ' . name . '&')
- call add(script, 'set ' . shortname . '&')
+ " cannot change 'termencoding' in GTK
+ if name != 'termencoding' || !has('gui_gtk')
+ call add(script, 'set ' . name . '&')
+ call add(script, 'set ' . shortname . '&')
+ endif
if name == 'verbosefile'
call add(script, 'call delete("xxx")')
endif
diff --git a/src/version.c b/src/version.c
index 8f0625d89..d44289ace 100644
--- a/src/version.c
+++ b/src/version.c
@@ -772,6 +772,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1349,
+/**/
1348,
/**/
1347,