From d131f7964b04ad71b2bda397beee2aba63a43332 Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Wed, 5 Nov 2025 23:17:10 +0100 Subject: Support CRLF line endings It now detects and saves properly. --- src/dged/text.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/dged/text.h') diff --git a/src/dged/text.h b/src/dged/text.h index ec14650..108ded8 100644 --- a/src/dged/text.h +++ b/src/dged/text.h @@ -10,6 +10,11 @@ struct text; +enum line_endings { + LineEnding_LF, + LineEnding_CRLF, +}; + struct text_chunk { uint8_t *text; uint32_t nbytes; @@ -34,6 +39,8 @@ void text_append(struct text *text, uint8_t *bytes, uint32_t nbytes, void text_delete(struct text *text, uint32_t start_line, uint32_t start_offset, uint32_t end_line, uint32_t end_offset); +enum line_endings text_get_line_ending(const struct text *); + uint32_t text_num_lines(const struct text *text); uint32_t text_line_size(const struct text *text, uint32_t lineidx); struct utf8_codepoint_iterator -- cgit v1.2.3