diff options
| author | WormHeamer | 2025-12-29 20:49:04 -0500 |
|---|---|---|
| committer | WormHeamer | 2025-12-29 20:49:04 -0500 |
| commit | 00c75b9bd3fb97349d7b91ad88bac6b4bdf4cfa3 (patch) | |
| tree | c77883de157f979f1ff2e716ddedc92e43e8579f /main.c | |
| parent | 0a9d0673049228a7527b39ab12d0a314198ceeef (diff) | |
fix next_par() and prev_par() hanging at end-of-file
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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; } |
