aboutsummaryrefslogtreecommitdiff
path: root/core/events.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 /core/events.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 'core/events.lua')
-rw-r--r--core/events.lua14
1 files changed, 2 insertions, 12 deletions
diff --git a/core/events.lua b/core/events.lua
index 302e6fda..0ef56b58 100644
--- a/core/events.lua
+++ b/core/events.lua
@@ -307,7 +307,7 @@ add_handler('uri_dropped',
if WIN32 then utf8_uri = utf8_uri:sub(2, -1) end -- ignore leading '/'
local uri = textadept.iconv(utf8_uri, _CHARSET, 'UTF-8')
if lfs.attributes(uri).mode ~= 'directory' then
- textadept.io.open(utf8_uri)
+ io.open_file(utf8_uri)
end
end
end
@@ -339,17 +339,7 @@ add_handler('margin_click',
buffer:toggle_fold(line)
end)
-add_handler('buffer_new',
- function() -- set additional buffer functions
- local buffer = buffer
- buffer.reload = textadept.io.reload
- buffer.set_encoding = textadept.io.set_encoding
- buffer.save = textadept.io.save
- buffer.save_as = textadept.io.save_as
- buffer.close = textadept.io.close
- buffer.encoding = 'UTF-8'
- set_title(buffer)
- end)
+add_handler('buffer_new', function() set_title(buffer) end)
add_handler('buffer_before_switch',
function() -- save buffer properties