aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/command_entry.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/textadept/command_entry.lua b/modules/textadept/command_entry.lua
index d3d2d1ea..31e3cff1 100644
--- a/modules/textadept/command_entry.lua
+++ b/modules/textadept/command_entry.lua
@@ -87,6 +87,14 @@ events.connect(events.COMMAND_ENTRY_KEYPRESS, function(code)
end
end)
+-- Executes Lua code on startup.
+local function execute(command)
+ local f, err = load(command, nil, 'bt', env)
+ if err then error(err) end
+ f()
+end
+args.register('-e', '--execute', 1, execute, 'Execute Lua code')
+
--[[ The function below is a Lua C function.
---