aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/session.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2010-06-10 22:54:51 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2010-06-10 22:54:51 -0400
commit7af3a62b748ab62596b6815ac97c9cf527513a6c (patch)
tree3b9aa55c6fe0b34bd71cbad9aacca2c90c01a07f /modules/textadept/session.lua
parent13dc7390e0ddfe7f2a1b11d5b50265a74448e44f (diff)
downloadtextadept-7af3a62b748ab62596b6815ac97c9cf527513a6c.tar.gz
textadept-7af3a62b748ab62596b6815ac97c9cf527513a6c.zip
Moved textadept.io into Lua's io table.
Renamed textadept.io.open to textadept.io.open_file to prevent conflicts.
Diffstat (limited to 'modules/textadept/session.lua')
-rw-r--r--modules/textadept/session.lua9
1 files changed, 5 insertions, 4 deletions
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()