From 835cef65fdc886bcda74a1b66649a78aa8f00d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 10 Nov 2016 22:23:36 +0100 Subject: vis-lua: change misnamed attribute values of `file.newlines` Also rename underlying C code. --- text.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'text.c') diff --git a/text.c b/text.c index 1333824..2163deb 100644 --- a/text.c +++ b/text.c @@ -1319,17 +1319,17 @@ bool text_sigbus(Text *txt, const char *addr) { enum TextNewLine text_newline_type(Text *txt){ if (!txt->newlines) { - txt->newlines = TEXT_NEWLINE_NL; /* default to UNIX style \n new lines */ + txt->newlines = TEXT_NEWLINE_LF; /* default to UNIX style \n new lines */ const char *start = txt->block ? txt->block->data : NULL; if (start) { const char *nl = memchr(start, '\n', txt->block->len); if (nl > start && nl[-1] == '\r') - txt->newlines = TEXT_NEWLINE_CRNL; + txt->newlines = TEXT_NEWLINE_CRLF; } else { char c; size_t nl = lines_skip_forward(txt, 0, 1, NULL); if (nl > 1 && text_byte_get(txt, nl-2, &c) && c == '\r') - txt->newlines = TEXT_NEWLINE_CRNL; + txt->newlines = TEXT_NEWLINE_CRLF; } } @@ -1338,8 +1338,8 @@ enum TextNewLine text_newline_type(Text *txt){ const char *text_newline_char(Text *txt) { static const char *types[] = { - [TEXT_NEWLINE_NL] = "\n", - [TEXT_NEWLINE_CRNL] = "\r\n", + [TEXT_NEWLINE_LF] = "\n", + [TEXT_NEWLINE_CRLF] = "\r\n", }; return types[text_newline_type(txt)]; } -- cgit v1.2.3