diff options
author | 2009-01-26 22:43:08 -0500 | |
---|---|---|
committer | 2009-01-26 22:43:08 -0500 | |
commit | 5644dd27197711b3a69d0dd05e6a1b82c404f027 (patch) | |
tree | 6aa561f7ac8edd7aeda19fecc913c7b9cbde08c9 /core/events.lua | |
parent | 6cd7f0016da3b5c138fa797cc8aaa9f8671b1419 (diff) | |
download | textadept-5644dd27197711b3a69d0dd05e6a1b82c404f027.tar.gz textadept-5644dd27197711b3a69d0dd05e6a1b82c404f027.zip |
Menu label text is irrelevant for menu actions due to l10n; focus on menu_id.
Diffstat (limited to 'core/events.lua')
-rw-r--r-- | core/events.lua | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/core/events.lua b/core/events.lua index fec8d4b9..8a2f86b8 100644 --- a/core/events.lua +++ b/core/events.lua @@ -65,8 +65,7 @@ module('textadept.events', package.seeall) -- shift: flag indicating whether or not shift is pressed. -- control: flag indicating whether or not control is pressed. -- alt: flag indicating whether or not alt is pressed. --- menu_clicked(menu_item, menu_id) --- menu_item: text of the menu item clicked. +-- menu_clicked(menu_id) -- menu_id: the numeric ID of the menu item. local events = textadept.events @@ -138,9 +137,8 @@ end function keypress(code, shift, control, alt) return handle('keypress', code, shift, control, alt) end -function menu_clicked(menu_item) - local text, menu_id = menu_item:match('^(.+)|(%d+)$') - return handle('menu_clicked', text, tonumber(menu_id)) +function menu_clicked(menu_id_str) + return handle('menu_clicked', tonumber(menu_id_str)) end -- Scintilla notifications. |