From 7af3a62b748ab62596b6815ac97c9cf527513a6c Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 10 Jun 2010 22:54:51 -0400 Subject: Moved textadept.io into Lua's io table. Renamed textadept.io.open to textadept.io.open_file to prevent conflicts. --- modules/textadept/run.lua | 2 +- modules/textadept/session.lua | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'modules/textadept') 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() -- cgit v1.2.3