# HG changeset patch # User Bram Moolenaar # Date 1612201506 -3600 # Node ID 8152b7daebad552d10be19cfdc3f8967afb3c66f # Parent 0dcd6d533273ecf632bdc26dc1c7a99238e42a89 patch 8.2.2446: setting 'term' empty has different error if compiled with GUI Commit: https://github.com/vim/vim/commit/5daa91162699e4f8b54f9d1caaaab2715038941c Author: Bram Moolenaar Date: Mon Feb 1 18:39:47 2021 +0100 patch 8.2.2446: setting 'term' empty has different error if compiled with GUI Problem: Setting 'term' empty has different error if compiled with GUI. Solution: Insert "else". (closes https://github.com/vim/vim/issues/7766) diff --git a/src/optionstr.c b/src/optionstr.c --- a/src/optionstr.c +++ b/src/optionstr.c @@ -687,7 +687,7 @@ did_set_string_option( if (T_NAME[0] == NUL) errmsg = N_("E529: Cannot set 'term' to empty string"); #ifdef FEAT_GUI - if (gui.in_use) + else if (gui.in_use) errmsg = N_("E530: Cannot change term in GUI"); else if (term_is_gui(T_NAME)) errmsg = N_("E531: Use \":gui\" to start the GUI"); diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim --- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -484,12 +484,10 @@ func Test_set_ttytype() set ttytype=xterm call assert_equal('xterm', &ttytype) call assert_equal(&ttytype, &term) - " "set ttytype=" gives E522 instead of E529 - " in travis on some builds. Why? Catch both for now try set ttytype= call assert_report('set ttytype= did not fail') - catch /E529\|E522/ + catch /E529/ endtry " Some systems accept any terminal name and return dumb settings, diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2446, +/**/ 2445, /**/ 2444,