changeset 20330:a7dbf32b5cc0 v8.2.0720

patch 8.2.0720: occasional exit when encountering an X error Commit: https://github.com/vim/vim/commit/b1062eb23e7a7a8b44f3416e79c3b28aa6c6c229 Author: Bram Moolenaar <Bram@vim.org> Date: Sat May 9 16:11:33 2020 +0200 patch 8.2.0720: occasional exit when encountering an X error Problem: Occasional exit when encountering an X error. (Manfred Lotz) Solution: On an X error do not exit, do preserve files.
author Bram Moolenaar <Bram@vim.org>
date Sat, 09 May 2020 16:15:04 +0200
parents 5658f8442037
children 85b7b3c3e19a
files src/os_unix.c src/version.c
diffstat 2 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -1544,10 +1544,15 @@ x_error_handler(Display *dpy, XErrorEven
     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
 }
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    720,
+/**/
     719,
 /**/
     718,