Skip to content

Commit

Permalink
pager: reinitialize column counter after a newline character
Browse files Browse the repository at this point in the history
  • Loading branch information
vadmeste committed Dec 19, 2014
1 parent c711a03 commit 8f2825f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/more.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8f2825f

Please sign in to comment.