From 78e70abc17f1290001cd9c05beab04f46d292596 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sat, 7 Jul 2012 22:19:01 +0100 Subject: [PATCH] End key moves to end of pad --- input_win.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/input_win.c b/input_win.c index a32ee4d7..97099dc1 100644 --- a/input_win.c +++ b/input_win.c @@ -226,7 +226,7 @@ static int _handle_edit(const int ch, char *input, int *size) return 1; case KEY_RIGHT: - if (inp_x <= *size ) + if (inp_x <= *size) wmove(inp_win, inp_y, inp_x+1); return 1; @@ -249,6 +249,10 @@ static int _handle_edit(const int ch, char *input, int *size) return 1; case KEY_END: + if (*size > cols-2) { + pad_start = ((*size) - cols) + 2; + prefresh(inp_win, 0, pad_start, rows-1, 0, rows-1, cols-1); + } wmove(inp_win, inp_y, (*size) + 1); return 1;