Replies: 1 comment
-
You can create a top-level menu. If you want it to appear after the "Tools" menu (before the "Buffer" menu), you'd put something like this in your *~/.textadept/init.lua*:
local function run_perl_command(cmd)
if not buffer.filename then return end -- nothing to do
textadept.run.run(string.format('%s "%s"', cmd, buffer.filename))
end
table.insert(textadept.menu.menubar, 5, {title = "Perl",
{"perlcheck", function() run_perl_command('perlcheck') end},
{"perltidy", function() run_perl_command('perltidy') end},
{"perlcritic", function() run_perl_command('perlcritic') end},
})
I haven't tested this, but that's the general idea.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This question has a couple of layers.
Can a new top-level menu item be added or does it need to be a sub-menu of an existing top level?
I would like to create a few commands to check my Perl scripts (perlcheck, perltidy, and perlcritic). How would I do that in light of the first question?
My Lua is generally non-existent, so sorry.
Beta Was this translation helpful? Give feedback.
All reactions