From fcdee2fc4635a82e4e204a8c0bb63bd5e5858441 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Fri, 19 Oct 2012 08:02:06 +1000 Subject: [PATCH] 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(-) diff --git a/linenoise.c b/linenoise.c index ba8ab2a..5c1672a 100644 --- a/linenoise.c +++ b/linenoise.c @@ -700,7 +700,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--; -- 2.44.0