From 287521cba09765d9d0901b79d8911a27de1af4e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 22 Apr 2015 21:20:59 +0200 Subject: Cleanup line ending type detection and insertion --- text.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'text.h') diff --git a/text.h b/text.h index 9f350f9..099cbe4 100644 --- a/text.h +++ b/text.h @@ -82,8 +82,15 @@ size_t text_history_get(Text*, size_t index); size_t text_size(Text*); bool text_modified(Text*); -/* test whether the underlying file uses UNIX style \n or Windows style \r\n newlines */ -bool text_newlines_crnl(Text*); + +/* which type of new lines does the text use? */ +enum TextNewLine { + TEXT_NEWLINE_NL = 1, + TEXT_NEWLINE_CRNL, +}; + +enum TextNewLine text_newline_type(Text*); + bool text_save(Text*, const char *file); bool text_range_save(Text*, Filerange*, const char *file); ssize_t text_write(Text*, int fd); -- cgit v1.2.3