diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-04-22 21:20:59 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-04-22 21:34:40 +0200 |
| commit | 287521cba09765d9d0901b79d8911a27de1af4e7 (patch) | |
| tree | 8a505debc63763bca159ba0b6c60cae02d583d9e /text.h | |
| parent | 6d7794c0356902bc816923f4409d9d39a62db171 (diff) | |
| download | vis-287521cba09765d9d0901b79d8911a27de1af4e7.tar.gz vis-287521cba09765d9d0901b79d8911a27de1af4e7.tar.xz | |
Cleanup line ending type detection and insertion
Diffstat (limited to 'text.h')
| -rw-r--r-- | text.h | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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); |
