From 04cd1420c1e160502962ca1432b8b76eaf2ec552 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Mon, 9 Jun 2008 19:13:43 +0200 Subject: [PATCH] Force flush output queue before presenting any dialog The previous commit did not ensure the output queue was flushed before "browse" dialogs were shown. --- src/MacVim/gui_macvim.m | 6 ++++++ src/message.c | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/MacVim/gui_macvim.m b/src/MacVim/gui_macvim.m index 16db6b7464..9e22970b9c 100644 --- a/src/MacVim/gui_macvim.m +++ b/src/MacVim/gui_macvim.m @@ -1286,6 +1286,9 @@ gui_mch_browse( //NSLog(@"gui_mch_browse(saving=%d, title=%s, dflt=%s, ext=%s, initdir=%s," // " filter=%s", saving, title, dflt, ext, initdir, filter); + // Ensure no data is on the output queue before presenting the dialog. + gui_macvim_force_flush(); + #ifdef FEAT_MBYTE title = CONVERT_TO_UTF8(title); initdir = CONVERT_TO_UTF8(initdir); @@ -1319,6 +1322,9 @@ gui_mch_dialog( // "dfltbutton=%d textfield=%s)", type, title, message, buttons, // dfltbutton, textfield); + // Ensure no data is on the output queue before presenting the dialog. + gui_macvim_force_flush(); + #ifdef FEAT_MBYTE title = CONVERT_TO_UTF8(title); message = CONVERT_TO_UTF8(message); diff --git a/src/message.c b/src/message.c index 4c39817712..b2daa90e22 100644 --- a/src/message.c +++ b/src/message.c @@ -3288,11 +3288,6 @@ do_dialog(type, title, message, buttons, dfltbutton, textfield) /* When GUI is running and 'c' not in 'guioptions', use the GUI dialog */ if (gui.in_use && vim_strchr(p_go, GO_CONDIALOG) == NULL) { -# ifdef FEAT_GUI_MACVIM - /* The 'swap file exists' dialog also displays text in the editor - * window so make sure this is flushed before showing the dialog. */ - gui_macvim_force_flush(); -# endif c = gui_mch_dialog(type, title, message, buttons, dfltbutton, textfield); msg_end_prompt();