diff options
| author | WormHeamer | 2025-12-28 19:45:08 -0500 |
|---|---|---|
| committer | WormHeamer | 2025-12-28 19:45:08 -0500 |
| commit | a24ee30efa43bcfc06b0e8b956bd077f8515c6e5 (patch) | |
| tree | f0a66957048b6671e91e83374f7b6295270b1b74 | |
| parent | 4d8eb0a7c13a69afe30f6a251ff0d72281650f77 (diff) | |
fix end_of_line() skipping empty lines
| -rw-r--r-- | main.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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) { |
