From f08657fa9afee6ea74dfdb9660dd4d23f20ee43f Mon Sep 17 00:00:00 2001 From: James Booth Date: Fri, 6 Feb 2015 14:11:21 +0000 Subject: [PATCH] Handle home scroll --- src/ui/inputwin.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c index 5ae6656e..6f043b31 100644 --- a/src/ui/inputwin.c +++ b/src/ui/inputwin.c @@ -327,8 +327,9 @@ _inp_win_handle_scroll(void) int col = getcurx(inp_win); int wcols = getmaxx(stdscr); - // if lost cursor off screen, move contents to show it - if (col >= pad_start + (wcols -2)) { + if (col == 0) { + pad_start = 0; + } else if (col >= pad_start + (wcols -2)) { pad_start = col - (wcols / 2); if (pad_start < 0) { pad_start = 0;