summaryrefslogtreecommitdiff
path: root/src/os_mswin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os_mswin.c')
-rw-r--r--src/os_mswin.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/os_mswin.c b/src/os_mswin.c
index 45b14783a..bddb08d92 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -2526,6 +2526,7 @@ serverGetReply(HWND server, int *expr_res, int remove, int wait)
int i;
char_u *reply;
reply_T *rep;
+ int did_process = FALSE;
/* When waiting, loop until the message waiting for is received. */
for (;;)
@@ -2562,7 +2563,17 @@ serverGetReply(HWND server, int *expr_res, int remove, int wait)
/* If we got here, we didn't find a reply. Return immediately if the
* "wait" parameter isn't set. */
if (!wait)
+ {
+ /* Process pending messages once. Without this, looping on
+ * remote_peek() would never get the reply. */
+ if (!did_process)
+ {
+ did_process = TRUE;
+ serverProcessPendingMessages();
+ continue;
+ }
break;
+ }
/* We need to wait for a reply. Enter a message loop until the
* "reply_received" flag gets set. */