aboutsummaryrefslogtreecommitdiff
path: root/linenoise.c
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2012-10-19 08:02:06 +1000
committerSteve Bennett <steveb@workware.net.au>2012-10-19 08:02:06 +1000
commit88697045767b05755a0a31a254e2e3af73c6a0c3 (patch)
treef19f58da317d67cd85173c3ad3c7c8b10fc5a20d /linenoise.c
parent0cca57a4d835a04638e2a662f16db7ca76165eba (diff)
downloadjimtcl-88697045767b05755a0a31a254e2e3af73c6a0c3.zip
jimtcl-88697045767b05755a0a31a254e2e3af73c6a0c3.tar.gz
jimtcl-88697045767b05755a0a31a254e2e3af73c6a0c3.tar.bz2
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 <steveb@workware.net.au>
Diffstat (limited to 'linenoise.c')
-rw-r--r--linenoise.c2
1 files changed, 1 insertions, 1 deletions
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--;