about summary refs log tree commit diff stats
path: root/input_win.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-07-07 21:12:14 +0100
committerJames Booth <boothj5@gmail.com>2012-07-07 21:12:14 +0100
commit7cfbf1cdc9a1ffe1bed432617fe7671e9c1ab1f9 (patch)
treee2a21b17e9a27d92499246288516e258fd05e47f /input_win.c
parent8ba47220ff3415902c9bc1ea22349a09ef838203 (diff)
downloadprofani-tty-7cfbf1cdc9a1ffe1bed432617fe7671e9c1ab1f9.tar.gz
Max size added for input
Diffstat (limited to 'input_win.c')
-rw-r--r--input_win.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/input_win.c b/input_win.c
index a52c5c68..a1545755 100644
--- a/input_win.c
+++ b/input_win.c
@@ -48,6 +48,7 @@
 #include "command.h"
 
 static WINDOW *inp_win;
+static int MAX_INP_SIZE = 1000;
 
 static int _handle_edit(const int ch, char *input, int *size);
 static int _printable(const int ch);
@@ -58,19 +59,18 @@ void create_input_window(void)
     int rows, cols;
     getmaxyx(stdscr, rows, cols);
 
-    inp_win = newpad(1, cols);
+    inp_win = newpad(1, MAX_INP_SIZE);
     wbkgd(inp_win, COLOR_PAIR(1));
     keypad(inp_win, TRUE);
     wmove(inp_win, 0, 1);
-    prefresh(inp_win, 0, 0, rows-1, 0, rows-1, cols);
+    prefresh(inp_win, 0, 0, rows-1, 0, rows-1, cols-1);
 }
 
 void inp_win_resize(const char * const input, const int size)
 {
     int rows, cols;
     getmaxyx(stdscr, rows, cols);
-    mvwin(inp_win, rows-1, 0);
-    prefresh(inp_win, 0, 0, rows-1, 0, rows-1, cols);
+    prefresh(inp_win, 0, 0, rows-1, 0, rows-1, cols-1);
 }
 
 void inp_clear(void)
@@ -79,7 +79,7 @@ void inp_clear(void)
     getmaxyx(stdscr, rows, cols);
     wclear(inp_win);
     wmove(inp_win, 0, 1);
-    prefresh(inp_win, 0, 0, rows-1, 0, rows-1, cols);
+    prefresh(inp_win, 0, 0, rows-1, 0, rows-1, cols-1);
 }
 
 void inp_non_block(void)
@@ -148,7 +148,7 @@ void inp_put_back(void)
 {
     int rows, cols;
     getmaxyx(stdscr, rows, cols);
-    prefresh(inp_win, 0, 0, rows-1, 0, rows-1, cols);
+    prefresh(inp_win, 0, 0, rows-1, 0, rows-1, cols-1);
 }
 
 /*