Revert "Revert "Don't service ioport completions if data is available on stdin""

This reverts commit 005e6f2ab8.

This allows new text entry to take priority over highlighting, improving the
performance of pasting.
This commit is contained in:
ridiculousfish 2019-06-23 16:19:13 -07:00
parent 89fb408eb6
commit 27e4d1d62d

View File

@ -104,13 +104,6 @@ char_event_t input_event_queue_t::readb() {
}
}
if (ioport > 0 && FD_ISSET(ioport, &fdset)) {
iothread_service_completion();
if (auto mc = pop_discard_timeouts()) {
return *mc;
}
}
if (FD_ISSET(STDIN_FILENO, &fdset)) {
unsigned char arr[1];
if (read_blocked(0, arr, 1) != 1) {
@ -121,6 +114,15 @@ char_event_t input_event_queue_t::readb() {
// We read from stdin, so don't loop.
return arr[0];
}
// Check for iothread completions only if there is no data to be read from the stdin.
// This gives priority to the foreground.
if (ioport > 0 && FD_ISSET(ioport, &fdset)) {
iothread_service_completion();
if (auto mc = pop_discard_timeouts()) {
return *mc;
}
}
}
}
}