about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/input_win.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/input_win.c b/src/input_win.c
index 112d3253..b53786a9 100644
--- a/src/input_win.c
+++ b/src/input_win.c
@@ -165,6 +165,8 @@ inp_get_char(char *input, int *size)
     // if it wasn't an arrow key etc
     if (!_handle_edit(ch, input, size)) {
         if (_printable(ch)) {
+            int rows, cols;
+            getmaxyx(stdscr, rows, cols);
             getyx(inp_win, inp_y, inp_x);
 
             // handle insert if not at end of input
@@ -186,6 +188,11 @@ inp_get_char(char *input, int *size)
                 wprintw(inp_win, next_ch);
                 wmove(inp_win, inp_y, inp_x + 1);
 
+                if (inp_x - pad_start > cols-3) {
+                    pad_start++;
+                    prefresh(inp_win, 0, pad_start, rows-1, 0, rows-1, cols-1);
+                }
+
             // otherwise just append
             } else {
                 char bytes[MB_CUR_MAX];