From 070f12d6eef343179335d12686c24f8055c2514d Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 12 Jul 2009 12:49:30 -0400 Subject: Lua code cleanup. --- core/file_io.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/file_io.lua') diff --git a/core/file_io.lua b/core/file_io.lua index b0131aa1..859e52c6 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -91,7 +91,6 @@ local function open_helper(utf8_filename) end local buffer = textadept.new_buffer() if text then - local c = textadept.constants -- Tries to detect character encoding and convert text from it to UTF-8. local encoding, encoding_bom = detect_encoding(text) if encoding ~= 'binary' then @@ -113,6 +112,7 @@ local function open_helper(utf8_filename) else encoding = nil end + local c = textadept.constants buffer.encoding, buffer.encoding_bom = encoding, encoding_bom buffer.code_page = encoding and c.SC_CP_UTF8 or 0 -- Tries to set the buffer's EOL mode appropriately based on the file. @@ -329,7 +329,7 @@ function load_session(filename, only_pm) local anchor, current_pos, first_visible_line, filename = line:match('^buffer: (%d+) (%d+) (%d+) (.+)$') if not filename:find('^%[.+%]$') then - textadept.io.open(filename or '', 'rb') + textadept.io.open(filename or '') else textadept.new_buffer() buffer._type = filename -- cgit v1.2.3