diff options
author | 2010-06-10 22:54:51 -0400 | |
---|---|---|
committer | 2010-06-10 22:54:51 -0400 | |
commit | 7af3a62b748ab62596b6815ac97c9cf527513a6c (patch) | |
tree | 3b9aa55c6fe0b34bd71cbad9aacca2c90c01a07f /modules | |
parent | 13dc7390e0ddfe7f2a1b11d5b50265a74448e44f (diff) | |
download | textadept-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')
-rw-r--r-- | modules/cpp/commands.lua | 2 | ||||
-rw-r--r-- | modules/lua/commands.lua | 4 | ||||
-rw-r--r-- | modules/textadept/run.lua | 2 | ||||
-rw-r--r-- | modules/textadept/session.lua | 9 |
4 files changed, 9 insertions, 8 deletions
diff --git a/modules/cpp/commands.lua b/modules/cpp/commands.lua index 263b6819..65f67ff4 100644 --- a/modules/cpp/commands.lua +++ b/modules/cpp/commands.lua @@ -26,7 +26,7 @@ local keys = _G.keys if type(keys) == 'table' then keys.cpp = { al = { - m = { textadept.io.open, + m = { io.open_file, textadept.iconv(_HOME..'/modules/cpp/init.lua', 'UTF-8', _CHARSET) }, }, diff --git a/modules/lua/commands.lua b/modules/lua/commands.lua index ac68ab84..5f544ae0 100644 --- a/modules/lua/commands.lua +++ b/modules/lua/commands.lua @@ -69,7 +69,7 @@ function goto_required() for path in package.path:gmatch('[^;]+') do path = path:gsub('?', file) if lfs.attributes(path) then - textadept.io.open(textadept.iconv(path, 'UTF-8', _CHARSET)) + io.open_file(textadept.iconv(path, 'UTF-8', _CHARSET)) break end end @@ -80,7 +80,7 @@ local keys = _G.keys if type(keys) == 'table' then keys.lua = { al = { - m = { textadept.io.open, + m = { io.open_file, textadept.iconv(_HOME..'/modules/lua/init.lua', 'UTF-8', _CHARSET) }, g = { goto_required }, 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() |