From 88697045767b05755a0a31a254e2e3af73c6a0c3 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Fri, 19 Oct 2012 08:02:06 +1000 Subject: Fix a linenoise bug when moving off the left If the buffer is too big to fit in the window and the cursor would move off the left edge of the windows, the display is not shown correctly. Signed-off-by: Steve Bennett --- linenoise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linenoise.c') diff --git a/linenoise.c b/linenoise.c index 418bede..e6f8ede 100644 --- a/linenoise.c +++ b/linenoise.c @@ -694,7 +694,7 @@ static void refreshLine(const char *prompt, struct current *current) n++; } - while (n >= current->cols) { + while (n >= current->cols && pos > 0) { b = utf8_tounicode(buf, &ch); if (ch < ' ') { n--; -- cgit v1.1