aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/cpp/commands.lua4
-rw-r--r--modules/lua/commands.lua1
-rw-r--r--modules/textadept/editing.lua4
-rw-r--r--modules/textadept/key_commands.lua8
-rw-r--r--modules/textadept/keys.lua4
-rw-r--r--modules/textadept/macros.lua6
6 files changed, 11 insertions, 16 deletions
diff --git a/modules/cpp/commands.lua b/modules/cpp/commands.lua
index 472ca130..62c06be2 100644
--- a/modules/cpp/commands.lua
+++ b/modules/cpp/commands.lua
@@ -8,7 +8,6 @@ module('_m.cpp.commands', package.seeall)
local keys = _G.keys
if type(keys) == 'table' then
local m_editing = _m.textadept.editing
- local m_handlers = textadept.handlers
keys.cpp = {
al = { textadept.io.open, _HOME..'/modules/cpp/init.lua' },
['s\n'] = { function()
@@ -18,10 +17,7 @@ if type(keys) == 'table' then
end },
cq = { m_editing.block_comment, '//~' },
['('] = { function()
---~ buffer.word_chars =
---~ '_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
m_editing.show_call_tip(_m.cpp.api, true)
---~ buffer:set_chars_default()
return false
end },
}
diff --git a/modules/lua/commands.lua b/modules/lua/commands.lua
index f3dbe333..2b59f171 100644
--- a/modules/lua/commands.lua
+++ b/modules/lua/commands.lua
@@ -71,7 +71,6 @@ end
local keys = _G.keys
if type(keys) == 'table' then
local m_editing = _m.textadept.editing
- local m_handlers = textadept.handlers
keys.lua = {
al = { textadept.io.open, _HOME..'/modules/lua/init.lua' },
ac = {
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 282d5ad3..d15ebb9b 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -55,7 +55,7 @@ local enclosure = {
single_tag = { left = '<', right = ' />' }
}
-textadept.handlers.add_handler_function('char_added',
+textadept.events.add_handler('char_added',
function(c) -- matches characters specified in char_matches
if char_matches[c] then
buffer:insert_text( -1, char_matches[c] )
@@ -154,7 +154,7 @@ function show_call_tip(api, start)
buffer:call_tip_show(current_call_tip.start_pos, call_tip)
end
-textadept.handlers.add_handler_function('call_tip_click',
+textadept.events.add_handler('call_tip_click',
function(position) -- display the next or previous call tip
if not buffer:call_tip_active() then return end
if position == 1 and current_call_tip.num > 1 then
diff --git a/modules/textadept/key_commands.lua b/modules/textadept/key_commands.lua
index 7493a6ec..2072795f 100644
--- a/modules/textadept/key_commands.lua
+++ b/modules/textadept/key_commands.lua
@@ -143,9 +143,9 @@ keys.ap = { 'goto_buffer', v, -1, false }
keys.can = { textadept.goto_view, 1, false }
keys.cap = { textadept.goto_view, -1, false }
-local m_handlers = textadept.handlers
-keys.cab = { m_handlers.handle, 'call_tip_click', 1 }
-keys.caf = { m_handlers.handle, 'call_tip_click', 2 }
+local m_events = textadept.events
+keys.cab = { m_events.handle, 'call_tip_click', 1 }
+keys.caf = { m_events.handle, 'call_tip_click', 2 }
keys.cs = { textadept.find.focus }
keys['c\t'] = { textadept.pm.focus }
@@ -180,7 +180,7 @@ local function toggle_setting(setting)
elseif type(state) == 'number' then
buffer[setting] = buffer[setting] == 0 and 1 or 0
end
- textadept.handlers.update_ui() -- for updating statusbar
+ textadept.events.update_ui() -- for updating statusbar
end
keys.ct.v = {} -- view chain
diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua
index 93d089a9..996cdabf 100644
--- a/modules/textadept/keys.lua
+++ b/modules/textadept/keys.lua
@@ -159,7 +159,7 @@ local function keypress(code, shift, control, alt)
local ret, retval = pcall( func, unpack(args) )
if ret then
if type(retval) == 'boolean' then return retval end
- else textadept.handlers.error(retval) end -- error
+ else textadept.events.error(retval) end -- error
end
return true
else
@@ -175,7 +175,7 @@ local function keypress(code, shift, control, alt)
else return true end
end
end
-textadept.handlers.add_handler_function('keypress', keypress, 1)
+textadept.events.add_handler('keypress', keypress, 1)
---
-- [Local function] Tries to get a key command based on the lexer and current
diff --git a/modules/textadept/macros.lua b/modules/textadept/macros.lua
index 0d81f105..c97a372b 100644
--- a/modules/textadept/macros.lua
+++ b/modules/textadept/macros.lua
@@ -38,7 +38,7 @@ local function macro_notification(msg, wParam, lParam)
textadept.statusbar_text = 'Macro recording'
end
end
-textadept.handlers.add_handler_function('macro_record', macro_notification)
+textadept.events.add_handler('macro_record', macro_notification)
---
-- Starts recording a macro.
@@ -81,7 +81,7 @@ function stop_recording()
list[macro_name] = current
save()
textadept.statusbar_text = 'Macro saved'
- textadept.handlers.handle('macro_saved')
+ textadept.events.handle('macro_saved')
else
textadept.statusbar_text = 'Macro not saved'
end
@@ -124,7 +124,7 @@ function delete(macro_name)
if list[macro_name] then
list[macro_name] = nil
save()
- textadept.handlers.handle('macro_deleted')
+ textadept.events.handle('macro_deleted')
end
end