1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Added back block for when cursor not at end of line

This commit is contained in:
James Booth 2013-01-05 22:30:21 +00:00
parent 54472ed501
commit db96aeadf0

View File

@ -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];