aboutsummaryrefslogtreecommitdiff
path: root/core/ext
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 /core/ext
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 'core/ext')
-rw-r--r--core/ext/find.lua2
-rw-r--r--core/ext/key_commands.lua16
-rw-r--r--core/ext/menu.lua4
3 files changed, 11 insertions, 11 deletions
diff --git a/core/ext/find.lua b/core/ext/find.lua
index d1686c9b..f8cf27c8 100644
--- a/core/ext/find.lua
+++ b/core/ext/find.lua
@@ -320,7 +320,7 @@ local function goto_file(pos, line_num)
end
end
end
- textadept.io.open(file)
+ io.open_file(file)
buffer:ensure_visible_enforce_policy(file_line_num - 1)
buffer:goto_line(file_line_num - 1)
end
diff --git a/core/ext/key_commands.lua b/core/ext/key_commands.lua
index 05543b4d..e0b9ae3a 100644
--- a/core/ext/key_commands.lua
+++ b/core/ext/key_commands.lua
@@ -136,12 +136,12 @@ if not MAC then
-- File
local m_session = _m.textadept.session
keys.cn = { t.new_buffer }
- keys.co = { t.io.open }
+ keys.co = { io.open_file }
-- TODO: { 'reload', b }
keys.cs = { 'save', b }
keys.cS = { 'save_as', b }
keys.cw = { 'close', b }
- keys.cW = { t.io.close_all }
+ keys.cW = { io.close_all }
-- TODO: { m_session.load } after prompting with open dialog
-- TODO: { m_session.save } after prompting with save dialog
keys.aq = { t.quit }
@@ -258,13 +258,13 @@ if not MAC then
local RECENT_FILES = 1
t.events.add_handler('user_list_selection',
function(type, text)
- if type == RECENT_FILES then t.io.open(text) end
+ if type == RECENT_FILES then io.open_file(text) end
end)
keys.ao = {
function()
local buffer = buffer
local files = {}
- for _, filename in ipairs(t.io.recent_files) do
+ for _, filename in ipairs(io.recent_files) do
table.insert(files, 1, filename)
end
local sep = buffer.auto_c_separator
@@ -293,12 +293,12 @@ else
-- File
local m_session = _m.textadept.session
keys.an = { t.new_buffer }
- keys.ao = { t.io.open }
+ keys.ao = { io.open_file }
-- TODO: { 'reload', b }
keys.as = { 'save', b }
keys.aS = { 'save_as', b }
keys.aw = { 'close', b }
- keys.aW = { t.io.close_all }
+ keys.aW = { io.close_all }
-- TODO: { m_session.load } after prompting with open dialog
-- TODO: { m_session.save } after prompting with save dialog
keys.aq = { t.quit }
@@ -420,13 +420,13 @@ else
local RECENT_FILES = 1
t.events.add_handler('user_list_selection',
function(type, text)
- if type == RECENT_FILES then t.io.open(text) end
+ if type == RECENT_FILES then io.open_file(text) end
end)
keys.co = {
function()
local buffer = buffer
local files = {}
- for _, filename in ipairs(t.io.recent_files) do
+ for _, filename in ipairs(io.recent_files) do
table.insert(files, 1, filename)
end
local sep = buffer.auto_c_separator
diff --git a/core/ext/menu.lua b/core/ext/menu.lua
index 9c71383e..98a2a8c3 100644
--- a/core/ext/menu.lua
+++ b/core/ext/menu.lua
@@ -327,12 +327,12 @@ end
local actions = {
-- File
[ID.NEW] = { t.new_buffer },
- [ID.OPEN] = { t.io.open },
+ [ID.OPEN] = { io.open_file },
[ID.RELOAD] = { 'reload', b },
[ID.SAVE] = { 'save', b },
[ID.SAVEAS] = { 'save_as', b },
[ID.CLOSE] = { 'close', b },
- [ID.CLOSE_ALL] = { t.io.close_all },
+ [ID.CLOSE_ALL] = { io.close_all },
[ID.LOAD_SESSION] = {
function()
local utf8_filename =