From 00c75b9bd3fb97349d7b91ad88bac6b4bdf4cfa3 Mon Sep 17 00:00:00 2001 From: WormHeamer Date: Mon, 29 Dec 2025 20:49:04 -0500 Subject: fix next_par() and prev_par() hanging at end-of-file --- main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 102a773..1f4496b 100644 --- a/main.c +++ b/main.c @@ -85,14 +85,14 @@ int empty_line(TxtLoc l) { } TxtLoc next_par(TxtLoc l) { - while (!at_end(l) && empty_line(l)) l = next_line(l); - while (!at_end(l) && !empty_line(l)) l = next_line(l); + while (!at_end(l) && empty_line(l)) l = next_newline(l); + while (!at_end(l) && !empty_line(l)) l = next_newline(l); return l; } TxtLoc prev_par(TxtLoc l) { - while (!at_start(l) && empty_line(l)) l = prev_line(l); - while (!at_start(l) && !empty_line(l)) l = prev_line(l); + while (!at_start(l) && empty_line(l)) l = prev_newline(l); + while (!at_start(l) && !empty_line(l)) l = prev_newline(l); return l; } -- cgit v1.2.3