From 28669b98b9e915161abeb1b7a79bdc9088f6d6c3 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 2 Dec 2015 17:52:46 +0100 Subject: support up and left MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/rq.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rq.c b/src/rq.c index 7ea61a6..3382a1f 100644 --- a/src/rq.c +++ b/src/rq.c @@ -278,7 +278,12 @@ static int display_file(int fd, int ttyfd, long rate) break; case 'A': /* up */ case 'D': /* left */ - ;/* TODO previous */ + while ((s != buffer) && strchr(" \f\n\r\t\v", *s)) s--; + while ((s != buffer) && !strchr(" \f\n\r\t\v", *s)) s--; + while ((s != buffer) && strchr(" \f\n\r\t\v", *s)) s--; + while ((s != buffer) && !strchr(" \f\n\r\t\v", *s)) s--; + if (s == buffer) + goto rewait; break; case 0: break; -- cgit v1.2.3-70-g09d2