diff options
author | 2010-06-11 00:24:35 -0400 | |
---|---|---|
committer | 2010-06-11 00:24:35 -0400 | |
commit | 7a4800f05f26067a1cef77e5431256aab4c3d675 (patch) | |
tree | c20a86c11384fd8adb88af3acdd7d7757ebd0555 /core/ext/key_commands.lua | |
parent | c83387e378f72b303d692d951da841b581b3d453 (diff) | |
download | textadept-7a4800f05f26067a1cef77e5431256aab4c3d675.tar.gz textadept-7a4800f05f26067a1cef77e5431256aab4c3d675.zip |
Renamed textadept.events to events, renamed 'handle' and 'add_handler'.
Diffstat (limited to 'core/ext/key_commands.lua')
-rw-r--r-- | core/ext/key_commands.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/ext/key_commands.lua b/core/ext/key_commands.lua index 297cb3a8..93f02713 100644 --- a/core/ext/key_commands.lua +++ b/core/ext/key_commands.lua @@ -2,6 +2,7 @@ local textadept = _G.textadept local locale = _G.locale +local events = _G.events --- -- Manages and defines key commands in Textadept. @@ -246,7 +247,7 @@ if not MAC then elseif type(state) == 'number' then buffer[setting] = buffer[setting] == 0 and 1 or 0 end - t.events.handle('update_ui') -- for updating statusbar + events.emit('update_ui') -- for updating statusbar end keys.ct.v = { e = { toggle_setting, 'view_eol' }, @@ -274,7 +275,7 @@ if not MAC then -- Miscellaneous not in standard menu. -- Recent files. local RECENT_FILES = 1 - t.events.add_handler('user_list_selection', + events.connect('user_list_selection', function(type, text) if type == RECENT_FILES then io.open_file(text) end end) @@ -408,7 +409,7 @@ else elseif type(state) == 'number' then buffer[setting] = buffer[setting] == 0 and 1 or 0 end - t.events.handle('update_ui') -- for updating statusbar + events.emit('update_ui') -- for updating statusbar end keys.at.v = { e = { toggle_setting, 'view_eol' }, @@ -436,7 +437,7 @@ else -- Miscellaneous not in standard menu. -- Recent files. local RECENT_FILES = 1 - t.events.add_handler('user_list_selection', + events.connect('user_list_selection', function(type, text) if type == RECENT_FILES then io.open_file(text) end end) @@ -589,7 +590,7 @@ local function keypress(code, shift, control, alt) if ch:find('[%p%d]') and #keychain == 0 then if buffer.anchor ~= buffer.current_pos then buffer:delete_back() end buffer:add_text(ch) - textadept.events.handle('char_added', code) + events.emit('char_added', code) return true end end @@ -649,4 +650,4 @@ local function keypress(code, shift, control, alt) end end end -textadept.events.add_handler('keypress', keypress, 1) +events.connect('keypress', keypress, 1) |