about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-07-08 03:31:54 +0100
committerJames Booth <boothj5@gmail.com>2012-07-08 03:31:54 +0100
commit0cfda7e11ca7143511d436341dbbb8e8c1bb51eb (patch)
tree76456f938d3a3610be9e4d9079f2a3797393be3b
parentd92499da7927b5ab4212d9353cfde20f0df56691 (diff)
downloadprofani-tty-0cfda7e11ca7143511d436341dbbb8e8c1bb51eb.tar.gz
Started resize
-rw-r--r--input_win.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/input_win.c b/input_win.c
index 0322885e..44c77302 100644
--- a/input_win.c
+++ b/input_win.c
@@ -72,8 +72,15 @@ void create_input_window(void)
 
 void inp_win_resize(const char * const input, const int size)
 {
-    int rows, cols;
+    int rows, cols, inp_x, inp_y;
     getmaxyx(stdscr, rows, cols);
+    getyx(inp_win, inp_y, inp_x);
+    
+    // if lost cursor off screen, move contents to show it
+    if (inp_x >= pad_start + cols) {
+        pad_start = inp_x - 10;
+    }
+
     prefresh(inp_win, pad_start, 0, rows-1, 0, rows-1, cols-1);
 }