aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept
diff options
context:
space:
mode:
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/run.lua2
-rw-r--r--modules/textadept/session.lua9
2 files changed, 6 insertions, 5 deletions
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua
index e03665cb..c14e8e2d 100644
--- a/modules/textadept/run.lua
+++ b/modules/textadept/run.lua
@@ -117,7 +117,7 @@ function goto_error(pos, line_num)
local utf8_filename = captures[error_detail.filename]
local filename = textadept.iconv(utf8_filename, _CHARSET, 'UTF-8')
if lfs.attributes(filename) then
- textadept.io.open(utf8_filename)
+ io.open_file(utf8_filename)
_m.textadept.editing.goto_line(captures[error_detail.line])
local msg = captures[error_detail.message]
if msg then buffer:call_tip_show(buffer.current_pos, msg) end
diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua
index 20b0c831..30d9e823 100644
--- a/modules/textadept/session.lua
+++ b/modules/textadept/session.lua
@@ -32,9 +32,9 @@ local lfs = require 'lfs'
-- @usage _m.textadept.session.load(filename)
function load(filename)
local not_found = {}
- local f = io.open(filename or DEFAULT_SESSION, 'rb')
+ local f = io.open_file(filename or DEFAULT_SESSION, 'rb')
if not f then
- if not textadept.io.close_all() then return false end
+ if not io.close_all() then return false end
end
if not f then return false end
local current_view, splits = 1, { [0] = {} }
@@ -44,7 +44,7 @@ function load(filename)
line:match('^buffer: (%d+) (%d+) (%d+) (.+)$')
if not filename:find('^%[.+%]$') then
if lfs.attributes(filename) then
- textadept.io.open(filename)
+ io.open_file(filename)
else
not_found[#not_found + 1] = filename
end
@@ -160,7 +160,8 @@ function save(filename)
local size = textadept.size
session[#session + 1] = ("size: %d %d"):format(size[1], size[2])
-- Write the session.
- local f = io.open(filename or textadept.session_file or DEFAULT_SESSION, 'wb')
+ local f =
+ io.open_file(filename or textadept.session_file or DEFAULT_SESSION, 'wb')
if f then
f:write(table.concat(session, '\n'))
f:close()