]> granicus.if.org Git - vim/commitdiff
patch 8.2.0720: occasional exit when encountering an X error v8.2.0720
authorBram Moolenaar <Bram@vim.org>
Sat, 9 May 2020 14:11:33 +0000 (16:11 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 9 May 2020 14:11:33 +0000 (16:11 +0200)
Problem:    Occasional exit when encountering an X error. (Manfred Lotz)
Solution:   On an X error do not exit, do preserve files.

src/os_unix.c
src/version.c

index f8fe2cb64b14f669b543eb7a12f0cc3414c2bf87..8424b11a3c087768efbb6d4aecf05ff8af850073 100644 (file)
@@ -1544,10 +1544,15 @@ x_error_handler(Display *dpy, XErrorEvent *error_event)
     XGetErrorText(dpy, error_event->error_code, (char *)IObuff, IOSIZE);
     STRCAT(IObuff, _("\nVim: Got X error\n"));
 
-    // We cannot print a message and continue, because no X calls are allowed
-    // here (causes my system to hang).  Silently continuing might be an
-    // alternative...
-    preserve_exit();               // preserve files and exit
+    // In the GUI we cannot print a message and continue, because no X calls
+    // are allowed here (causes my system to hang).  Silently continuing seems
+    // like the best alternative.  Do preserve files, in case we crash.
+    ml_sync_all(FALSE, FALSE);
+
+#ifdef FEAT_GUI
+    if (!gui.in_use)
+#endif
+       msg((char *)IObuff);
 
     return 0;          // NOTREACHED
 }
index 5903a00e26a08b7c0240b896059372e6346b5650..456516f97151a4587ad05390e10a46bd9f4ded4d 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    720,
 /**/
     719,
 /**/