From 879e4723bd1ca8139d935574dd15ccd8c1ea77f5 Mon Sep 17 00:00:00 2001 From: dodococo Date: Wed, 4 Sep 2019 22:32:13 +0530 Subject: [PATCH] Fix autocompletion popup (#14958) --- libr/cons/cons.c | 1 + libr/cons/dietline.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libr/cons/cons.c b/libr/cons/cons.c index 12c35fc4c8..82555a7ef4 100644 --- a/libr/cons/cons.c +++ b/libr/cons/cons.c @@ -370,6 +370,7 @@ R_API int r_cons_get_cur_line() { #if __UNIX__ char buf[8]; struct termios save,raw; + fflush(stdout); // flush the Arrow keys escape keys which was messing up the output (void) tcgetattr (0, &save); cfmakeraw (&raw); (void) tcsetattr (0, TCSANOW, &raw); diff --git a/libr/cons/dietline.c b/libr/cons/dietline.c index c874196487..5a2c4eaf24 100644 --- a/libr/cons/dietline.c +++ b/libr/cons/dietline.c @@ -542,7 +542,7 @@ static void selection_widget_draw() { pos_y = r_cons_get_cur_line (); if (pos_y + sel_widget->h > cons->rows) { printf ("%s\n", r_str_pad('\n', sel_widget->h)); - pos_y = cons->rows - sel_widget->h; + pos_y = cons->rows - sel_widget->h - 1; } } sel_widget->w = R_MIN (sel_widget->w, R_SELWIDGET_MAXW);