From 8abba0db914bc8e8286aa2517b76ff1d7d3e17a2 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sat, 7 Jul 2012 21:59:01 +0100 Subject: [PATCH] Home key moves to start of pad --- input_win.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/input_win.c b/input_win.c index 803570ad..a32ee4d7 100644 --- a/input_win.c +++ b/input_win.c @@ -168,7 +168,7 @@ void inp_put_back(void) */ static int _handle_edit(const int ch, char *input, int *size) { - int i; + int i, rows, cols; char *prev = NULL; char *next = NULL; char *found = NULL; @@ -177,6 +177,7 @@ static int _handle_edit(const int ch, char *input, int *size) int inp_x = 0; char inp_cpy[*size]; + getmaxyx(stdscr, rows, cols); getyx(inp_win, inp_y, inp_x); switch(ch) { @@ -243,6 +244,8 @@ static int _handle_edit(const int ch, char *input, int *size) case KEY_HOME: wmove(inp_win, inp_y, 1); + pad_start = 0; + prefresh(inp_win, 0, pad_start, rows-1, 0, rows-1, cols-1); return 1; case KEY_END: