]> granicus.if.org Git - vim/commitdiff
patch 8.2.2446: setting 'term' empty has different error if compiled with GUI v8.2.2446
authorBram Moolenaar <Bram@vim.org>
Mon, 1 Feb 2021 17:39:47 +0000 (18:39 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 1 Feb 2021 17:39:47 +0000 (18:39 +0100)
Problem:    Setting 'term' empty has different error if compiled with GUI.
Solution:   Insert "else". (closes #7766)

src/optionstr.c
src/testdir/test_options.vim
src/version.c

index 8f3f0c5edc061b7da216a6c3c1967729e5d53f97..c8a5b0c6583da1afc207a529cc06c2b61fb2ad8d 100644 (file)
@@ -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");
index cc02c5c7cac4eae41c2319d208c82b9b21250a5c..c8b2700ddaa33d16ae764f2010d82d7a22e43da5 100644 (file)
@@ -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,
index 9fa14cbe871da050aa27d7796b846dac43a5b6d3..bba9da818f791527db9b99bff4e6d9960c3255ce 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2446,
 /**/
     2445,
 /**/