From 7ceba65d88079536d3b4b7132ad93fb3943c483d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Mon, 27 Apr 2020 10:50:35 -0300 Subject: Fix scrolling bug --- jet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jet.c b/jet.c index 586b791..00a8588 100644 --- a/jet.c +++ b/jet.c @@ -38,11 +38,11 @@ int main(int argc, char *argv[]) { int number_of_lines = 0; int x = -1, y = -1; for (struct point i = {page, 0}; !at_eof(&i); move_point_forward(&i)) { - if (element(&i) == '\n') number_of_lines++; if (same_location(&i, &cursor)) { getyx(stdscr, y, x); } if (number_of_lines >= current_line && number_of_lines < window_height + current_line) addch(element(&i)); + if (element(&i) == '\n') number_of_lines++; } if (x > -1 && y > -1) { move(y, x); -- cgit v1.2.3