From a24ee30efa43bcfc06b0e8b956bd077f8515c6e5 Mon Sep 17 00:00:00 2001 From: WormHeamer Date: Sun, 28 Dec 2025 19:45:08 -0500 Subject: fix end_of_line() skipping empty lines --- main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'main.c') 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) { -- cgit v1.2.3