Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ executor.commands.run_with_new_command()
executor.commands.show_presets()
executor.commands.show_history()
executor.commands.run_one_off(cmd)

-- some minimal API which does not trigger user interactions
executor.api.set_task_command(cmd)
executor.api.run_task(cmd?)
```

You can therefore map the Vim commands to a key:
Expand Down
10 changes: 10 additions & 0 deletions lua/executor/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,16 @@ Public.commands = {
end,
}

Public.api = {
set_task_command = Executor.set_task_command,
run_task = function(cmd)
if not cmd and not Executor._stored_task_command then
error("no command provided as argument and no stored task command found for api.run_task")
end
Executor.run_task(cmd)
end,
}

vim.api.nvim_create_user_command("ExecutorReset", function()
Public.commands.reset()
end, {})
Expand Down