summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorWormHeamer2025-12-28 19:45:08 -0500
committerWormHeamer2025-12-28 19:45:08 -0500
commita24ee30efa43bcfc06b0e8b956bd077f8515c6e5 (patch)
treef0a66957048b6671e91e83374f7b6295270b1b74 /main.c
parent4d8eb0a7c13a69afe30f6a251ff0d72281650f77 (diff)
fix end_of_line() skipping empty lines
Diffstat (limited to 'main.c')
-rw-r--r--main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.c b/main.c
index af9094a..0fe9513 100644
--- a/main.c
+++ b/main.c
@@ -88,7 +88,8 @@ TxtLoc start_of_line(Txt *t, TxtLoc l) {
}
TxtLoc end_of_line(Txt *t, TxtLoc l) {
- return next_newline(t, start_of_line(t, l));
+ TxtLoc start = start_of_line(t, l);
+ return txt_byte(t, start) == '\n' ? start : next_newline(t, start);
}
u32 get_col(Txt *t, TxtLoc l) {