Skip to content

Commit

Permalink
feat: allow terminal cmd to be a function
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers authored and goolord committed Feb 22, 2023
1 parent b3eef69 commit c46c0c8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/alpha/term.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ function M.run_command(cmd, el)
if cmd == nil then
return
end

if type(cmd) == 'function' then
cmd = cmd()
end

vim.loop.new_async(vim.schedule_wrap(function()
local wininfo = M.open_window(el)
Expand Down

0 comments on commit c46c0c8

Please sign in to comment.