From 8f2825fb08c9bd491ff146b4b13f0eda5333699a Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Fri, 19 Dec 2014 20:20:09 +0000 Subject: [PATCH] pager: reinitialize column counter after a newline character --- src/more.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/more.c b/src/more.c index bf67a82..1e76450 100644 --- a/src/more.c +++ b/src/more.c @@ -98,8 +98,11 @@ more(char* buffer) goto end; if (input == ' ' && c == '\n') next_page = 1; - if (c == '\n' && ++lines == (rows + 1)) + if (c == '\n') { + col_pos = 0; + if (++lines == (rows + 1)) next_page = 1; + } if (c == '\x1b') escape_seq = 1;