From: Steve Bennett Date: Thu, 18 Oct 2012 22:02:06 +0000 (+1000) Subject: Fix a linenoise bug when moving off the left X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=fcdee2fc4635a82e4e204a8c0bb63bd5e5858441;p=linenoise.git 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 --- 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--;