diff options
author | 2010-06-10 22:54:51 -0400 | |
---|---|---|
committer | 2010-06-10 22:54:51 -0400 | |
commit | 7af3a62b748ab62596b6815ac97c9cf527513a6c (patch) | |
tree | 3b9aa55c6fe0b34bd71cbad9aacca2c90c01a07f /core/events.lua | |
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 'core/events.lua')
-rw-r--r-- | core/events.lua | 14 |
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 |