Skip to content

Commit 2f9e467

Browse files
authored
Merge pull request #684 from ichizok/fix/termwin
Fix: terminal-window does not update immediately
2 parents 8c9b721 + aed702f commit 2f9e467

3 files changed

Lines changed: 11 additions & 16 deletions

File tree

src/MacVim/MMBackend.m

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -703,24 +703,14 @@ - (BOOL)waitForInput:(int)milliseconds
703703
forMode:NSDefaultRunLoopMode];
704704
}
705705

706-
CFAbsoluteTime lastTime =
707-
milliseconds >= 0 ? CFAbsoluteTimeGetCurrent() : .0;
708-
709706
while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, dt, true)
710707
== kCFRunLoopRunHandledSource) {
711-
// In order to ensure that all input (except for channel) on the
712-
// run-loop has been processed we set the timeout to 0 and keep
713-
// processing until the run-loop times out.
714-
if ([inputQueue count] > 0 || input_available() || got_int) {
715-
dt = 0.0;
708+
// In order to ensure that all input on the run-loop has been
709+
// processed we set the timeout to 0 and keep processing until the
710+
// run-loop times out.
711+
dt = 0.0;
712+
if ([inputQueue count] > 0 || input_available() || got_int)
716713
inputReceived = YES;
717-
} else if (milliseconds >= 0) {
718-
CFAbsoluteTime nowTime = CFAbsoluteTimeGetCurrent();
719-
720-
if ((dt -= nowTime - lastTime) <= 0.0)
721-
break;
722-
lastTime = nowTime;
723-
}
724714
}
725715

726716
if ([inputQueue count] > 0 || input_available() || got_int)

src/gui.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,6 @@ typedef enum
577577
# endif
578578
#endif /* FEAT_GUI_GTK */
579579

580-
#if defined(UNIX) && !defined(FEAT_GUI_MAC)
580+
#if defined(UNIX) && !(defined(FEAT_GUI_MAC) || defined(FEAT_GUI_MACVIM))
581581
# define GUI_MAY_FORK
582582
#endif

src/terminal.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,11 @@ write_to_term(buf_T *buffer, char_u *msg, channel_T *channel)
981981
* already */
982982
if (buffer == curbuf && curbuf->b_term != NULL)
983983
update_cursor(curbuf->b_term, TRUE);
984+
#ifdef FEAT_GUI_MACVIM
985+
/* Force a flush now for better experience of interactive shell. */
986+
if (gui.in_use)
987+
gui_macvim_force_flush();
988+
#endif
984989
}
985990
else
986991
redraw_after_callback(TRUE);

0 commit comments

Comments
 (0)