diff options
author | James Booth <boothj5@gmail.com> | 2013-01-05 22:30:21 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-01-05 22:30:21 +0000 |
commit | db96aeadf08b2aa57e6e87b8e9d4022d48e6131f (patch) | |
tree | c4936c285753b5979c4c592d9a83c470ce7c4672 | |
parent | 54472ed5016adb2d87957599ddfff274f39da585 (diff) | |
download | profani-tty-db96aeadf08b2aa57e6e87b8e9d4022d48e6131f.tar.gz |
Added back block for when cursor not at end of line
-rw-r--r-- | src/input_win.c | 7 |
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]; |