summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWormHeamer2025-12-29 20:49:04 -0500
committerWormHeamer2025-12-29 20:49:04 -0500
commit00c75b9bd3fb97349d7b91ad88bac6b4bdf4cfa3 (patch)
treec77883de157f979f1ff2e716ddedc92e43e8579f
parent0a9d0673049228a7527b39ab12d0a314198ceeef (diff)
fix next_par() and prev_par() hanging at end-of-file
-rw-r--r--main.c8
1 files changed, 4 insertions, 4 deletions
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;
}