From db96aeadf08b2aa57e6e87b8e9d4022d48e6131f Mon Sep 17 00:00:00 2001 From: James Booth Date: Sat, 5 Jan 2013 22:30:21 +0000 Subject: Added back block for when cursor not at end of line --- src/input_win.c | 7 +++++++ 1 file changed, 7 insertions(+) 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]; -- cgit 1.4.1-2-gfad0