Introduce char_event_type_t::readline

Baby steps towards eliminating readline actions as characters.
This commit is contained in:
ridiculousfish
2019-03-16 16:48:23 -07:00
parent 14663089c8
commit c2be5e8986
5 changed files with 28 additions and 16 deletions

View File

@@ -192,7 +192,7 @@ char_event_t input_common_readch() {
mbstate_t state = {};
while (1) {
auto evt = readb();
if (!evt.is_char() || evt.is_readline()) {
if (!evt.is_char()) {
return evt;
}
@@ -239,7 +239,7 @@ char_event_t input_common_readch_timed(bool dequeue_timeouts) {
if (!dequeue_timeouts) lookahead_push_front(char_event_type_t::timeout);
return char_event_type_t::timeout;
}
return result.get_char();
return result;
}
void input_common_queue_ch(char_event_t ch) { lookahead_push_back(ch); }