From 7e88330753edcf2df034e2240c2e77e1006d2e64 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Mon, 9 Sep 2013 21:48:15 -0400 Subject: Moved buffer IO functions into the `io` module. Menus and key bindings do not need `events.INITIALIZED`. --- modules/textadept/keys.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'modules/textadept/keys.lua') diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua index 3acb2a28..f7cb599b 100644 --- a/modules/textadept/keys.lua +++ b/modules/textadept/keys.lua @@ -258,7 +258,7 @@ M.utils = { events.emit(events.UPDATE_UI) -- for updating statusbar end, set_encoding = function(encoding) - buffer:set_encoding(encoding) + io.set_buffer_encoding(encoding) events.emit(events.UPDATE_UI) -- for updating statusbar end, set_eol_mode = function(mode) @@ -363,11 +363,11 @@ for _, f in ipairs(menu_buffer_functions) do buffer[f] = buffer[f] end keys[not OSX and (not CURSES and 'cn' or 'cmn') or 'mn'] = buffer.new keys[not OSX and 'co' or 'mo'] = io.open_file keys[not OSX and not CURSES and 'cao' or 'cmo'] = io.open_recent_file -keys[not OSX and (not CURSES and 'cO' or 'mo') or 'mO'] = buffer.reload -keys[not OSX and 'cs' or 'ms'] = buffer.save -keys[not OSX and (not CURSES and 'cS' or 'cms') or 'mS'] = buffer.save_as -keys[not OSX and 'cw' or 'mw'] = buffer.close -keys[not OSX and (not CURSES and 'cW' or 'cmw') or 'mW'] = io.close_all +keys[not OSX and (not CURSES and 'cO' or 'mo') or 'mO'] = io.reload_file +keys[not OSX and 'cs' or 'ms'] = io.save_file +keys[not OSX and (not CURSES and 'cS' or 'cms') or 'mS'] = io.save_file_as +keys[not OSX and 'cw' or 'mw'] = io.close_buffer +keys[not OSX and (not CURSES and 'cW' or 'cmw') or 'mW'] = io.close_all_buffers -- TODO: textadept.sessions.load -- TODO: textadept.sessions.save keys[not OSX and 'cq' or 'mq'] = quit -- cgit v1.2.3