Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
rline: drain, don't flush, when switching modes
Browse files Browse the repository at this point in the history
  • Loading branch information
klange committed Mar 1, 2024
1 parent db7495c commit 24d5d9c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/rline.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,11 @@ static int paint_krk_numeral(struct syntax_state * state) {
paint(1, FLAG_NUMERAL);
while (isdigit(charat())) paint(1, FLAG_NUMERAL);
}
if (charat() == 'e' || charat() == 'E') {
paint(1, FLAG_NUMERAL);
if (charat() == '-' || charat() == '+') paint(1, FLAG_NUMERAL);
while (isdigit(charat())) paint(1, FLAG_NUMERAL);
}
}
return 0;
}
Expand Down Expand Up @@ -2017,12 +2022,12 @@ static void set_unbuffered(void) {
_EOF = old.c_cc[VEOF];
struct termios new = old;
new.c_lflag &= (~ICANON & ~ECHO & ~ISIG);
tcsetattr(STDOUT_FILENO, TCSAFLUSH, &new);
tcsetattr(STDOUT_FILENO, TCSADRAIN, &new);
if (wcwidth(0x3042) != 2) setlocale(LC_CTYPE, "");
}

static void set_buffered(void) {
tcsetattr(STDOUT_FILENO, TCSAFLUSH, &old);
tcsetattr(STDOUT_FILENO, TCSADRAIN, &old);
}
#else
static unsigned int _INTR = 3;
Expand Down

0 comments on commit 24d5d9c

Please sign in to comment.