From fc20fd1a9b74c1059775446baf921181433801aa Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 15 Jun 2016 08:49:28 -0400 Subject: Removed explicit detection and use of extinct CR line endings. It's quite possible some of Textadept's functions didn't handle them properly anyway. --- core/file_io.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'core/file_io.lua') diff --git a/core/file_io.lua b/core/file_io.lua index 9a8a8271..46a537a4 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -83,8 +83,6 @@ io.recent_files = {} -- @name encodings io.encodings = {'UTF-8', 'ASCII', 'ISO-8859-1', 'MacRoman'} -local c = _SCINTILLA.constants -local EOLs = {['\r\n'] = c.EOL_CRLF, ['\r'] = c.EOL_CR, ['\n'] = c.EOL_LF} --- -- Opens *filenames*, a string filename or list of filenames, or the -- user-selected filenames. @@ -133,7 +131,7 @@ function io.open_file(filenames) end buffer.code_page = buffer.encoding and buffer.CP_UTF8 or 0 -- Detect EOL mode. - buffer.eol_mode = EOLs[text:match('\r\n?')] or buffer.EOL_LF + buffer.eol_mode = text:find('\r\n') and buffer.EOL_CRLF or buffer.EOL_LF -- Insert buffer text and set properties. buffer:add_text(text, #text) buffer:goto_pos(0) -- cgit v1.2.3