aboutsummaryrefslogtreecommitdiff
path: root/core/file_io.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2009-07-12 12:49:30 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2009-07-12 12:49:30 -0400
commit070f12d6eef343179335d12686c24f8055c2514d (patch)
treebe54f4c787825ed85788cddd50fdb4c43966d7d1 /core/file_io.lua
parent741ce69b41705b7ad048283e6893ebcb693326fc (diff)
downloadtextadept-070f12d6eef343179335d12686c24f8055c2514d.tar.gz
textadept-070f12d6eef343179335d12686c24f8055c2514d.zip
Lua code cleanup.
Diffstat (limited to 'core/file_io.lua')
-rw-r--r--core/file_io.lua4
1 files changed, 2 insertions, 2 deletions
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