aboutsummaryrefslogtreecommitdiff
path: root/core/ext
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2009-01-26 22:43:08 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2009-01-26 22:43:08 -0500
commit5644dd27197711b3a69d0dd05e6a1b82c404f027 (patch)
tree6aa561f7ac8edd7aeda19fecc913c7b9cbde08c9 /core/ext
parent6cd7f0016da3b5c138fa797cc8aaa9f8671b1419 (diff)
downloadtextadept-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/ext')
-rw-r--r--core/ext/menu.lua16
1 files changed, 14 insertions, 2 deletions
diff --git a/core/ext/menu.lua b/core/ext/menu.lua
index 9124f748..cc1ae5c6 100644
--- a/core/ext/menu.lua
+++ b/core/ext/menu.lua
@@ -559,12 +559,24 @@ local actions = {
[ID.SHOW_PM_MODULES] = { pm_activate, 'modules' },
}
+-- lexers here MUST be in the same order as in the menu
+local lexers = {
+ 'actionscript', 'ada', 'antlr', 'apdl', 'applescript', 'asp', 'awk', 'batch',
+ 'boo', 'container', 'cpp', 'csharp', 'css', 'd', 'diff', 'django', 'eiffel',
+ 'erlang', 'errorlist', 'forth', 'fortran', 'gap', 'gettext', 'gnuplot',
+ 'groovy', 'haskell', 'html', 'idl', 'ini', 'io', 'java', 'javascript',
+ 'latex', 'lisp', 'lua', 'makefile', 'mysql', 'objective__c', 'ocaml',
+ 'pascal', 'perl', 'php', 'pike', 'postscript', 'props', 'python', 'r',
+ 'ragel', 'rebol', 'rexx', 'rhtml', 'ruby', 'scheme', 'shellscript',
+ 'smalltalk', 'tcl', 'vala', 'verilog', 'vhdl', 'visualbasic', 'xml'
+}
+
-- Most of this handling code comes from keys.lua.
t.events.add_handler('menu_clicked',
- function(menu_item, menu_id)
+ function(menu_id)
local active_table = actions[menu_id]
if menu_id >= ID.LEXER_ACTIONSCRIPT and menu_id <= ID.LEXER_XML then
- active_table = { set_lexer_language, menu_item }
+ active_table = { set_lexer_language, lexers[menu_id - 800] }
end
local f, args
if active_table and #active_table > 0 then