~smlavine/navipage

85435e9860d8f8c7b15c1867ab59b1ec148e7cbc — Sebastian LaVine a month ago de3438b
Clear every line before printing, don't clear entire screen beforehand

This makes navipage actually usable on a tty. Without this change, the
screen flashes whenever the screen in scrolled, and if constantly
scrolling, only half the screen is actually visible.

The performance impact is negligible.
1 files changed, 2 insertions(+), 1 deletions(-)

M main.c
M main.c => main.c +2 -1
@@ 375,7 375,6 @@ display_buffer(const Buffer *const b)
{
	int i, linestoprint;

	cls();
	gotoxy(1, 1);

	/* The amount of lines to be printed in this call. Print `rows - 1`


@@ 398,6 397,8 @@ display_buffer(const Buffer *const b)

		linelen = eolptr - b->st[b->top + i] + 1;

		clear_current_line();

		/* Print the line number at the start of each line. */
		if (flags.numbers)
			printf("%3d ", b->top + i + 1);