]> granicus.if.org Git - vim/commitdiff
patch 8.1.1301: when compiled with VIMDLL some messages are not shown v8.1.1301
authorBram Moolenaar <Bram@vim.org>
Wed, 8 May 2019 20:28:46 +0000 (22:28 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 8 May 2019 20:28:46 +0000 (22:28 +0200)
Problem:    When compiled with VIMDLL some messages are not shown.
Solution:   Set/reset gui.in_use and gui.starting as needed. (Ken Takata,
            closes #4361)

src/gui_w32.c
src/main.c
src/message.c
src/version.c

index 7bea58e97c2c5afa6b9a134a25ecfd0618be8771..69212ebb759f73e6e59b6929e00705821e08fbaf 100644 (file)
@@ -4827,6 +4827,10 @@ ole_error(char *arg)
 {
     char buf[IOSIZE];
 
+# ifdef VIMDLL
+    gui.in_use = mch_is_gui_executable();
+# endif
+
     /* Can't use emsg() here, we have not finished initialisation yet. */
     vim_snprintf(buf, IOSIZE,
            _("E243: Argument not supported: \"-%s\"; Use the OLE version."),
index a57b196cf7e16cdeeaa70fc9fcde5abde7622fe7..6d30143a3c6a393bb18bfd9bdcede22b2f3987bc 100644 (file)
@@ -178,6 +178,8 @@ main
 #ifdef VIMDLL
     // Check if the current executable file is for the GUI subsystem.
     gui.starting = mch_is_gui_executable();
+#elif defined(FEAT_GUI_MSWIN)
+    gui.starting = TRUE;
 #endif
 
 #ifdef FEAT_CLIENTSERVER
@@ -3242,6 +3244,14 @@ mainerr(
     reset_signals();           /* kill us with CTRL-C here, if you like */
 #endif
 
+    // If this is a Windows GUI executable, show an error dialog box.
+#ifdef VIMDLL
+    gui.in_use = mch_is_gui_executable();
+#endif
+#ifdef FEAT_GUI_MSWIN
+    gui.starting = FALSE;   // Needed to show as error.
+#endif
+
     init_longVersion();
     mch_errmsg(longVersion);
     mch_errmsg("\n");
index 038ccd640f980c166aa71d69d9b9311fc3df8ab1..7c256585dcf903bdddeaf89b5da9ad43963e408c 100644 (file)
@@ -2977,7 +2977,7 @@ mch_errmsg(char *str)
     int                len;
 #endif
 
-#if (defined(UNIX) || defined(FEAT_GUI)) && (!defined(ALWAYS_USE_GUI) || !defined(VIMDLL))
+#if (defined(UNIX) || defined(FEAT_GUI)) && !defined(ALWAYS_USE_GUI) && !defined(VIMDLL)
     /* On Unix use stderr if it's a tty.
      * When not going to start the GUI also use stderr.
      * On Mac, when started from Finder, stderr is the console. */
@@ -3080,7 +3080,7 @@ mch_msg_c(char *str)
     void
 mch_msg(char *str)
 {
-#if (defined(UNIX) || defined(FEAT_GUI)) && (!defined(ALWAYS_USE_GUI) || !defined(VIMDLL))
+#if (defined(UNIX) || defined(FEAT_GUI)) && !defined(ALWAYS_USE_GUI) && !defined(VIMDLL)
     /* On Unix use stdout if we have a tty.  This allows "vim -h | more" and
      * uses mch_errmsg() when started from the desktop.
      * When not going to start the GUI also use stdout.
index 7905cdac1953732feb1d8fdb3a88c9e1a631ee0f..6f6456b2144d2b5b0df0ce429b94c7d9d14c6f3f 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1301,
 /**/
     1300,
 /**/