stevearc / overseer.nvim

A task runner and job management plugin for Neovim
MIT License
1.22k stars 58 forks source link

Template execution error #31

Closed ranjithshegde closed 2 years ago

ranjithshegde commented 2 years ago

I can see that with commit ce49d5237546e441a1780331d5d8ec1cd9bf9155, the template registration was changed to accept a callback. But since then, none of my templates that used to work previously work anymore. It throws the following error.

E5108: Error executing lua .../packer/opt/overseer.nvim/lua/overseer/template/init.lua:295: attempt to call upvalue 'cb' (a nil value)
stack traceback:
        .../packer/opt/overseer.nvim/lua/overseer/template/init.lua:295: in function 'final_callback'
        .../packer/opt/overseer.nvim/lua/overseer/template/init.lua:341: in function 'list'
        .../packer/opt/overseer.nvim/lua/overseer/template/init.lua:353: in function 'get_by_name'
        .../pack/packer/opt/overseer.nvim/lua/overseer/commands.lua:163: in function 'run_template'
        /home/ranjith/.config/nvim/lua/r/utils/compiler.lua:9: in function 'sequencer'
        /home/ranjith/.config/nvim/lua/r/utils/compiler.lua:125: in function 'callback'
        ...cker/opt/dressing.nvim/lua/dressing/select/telescope.lua:112: in function 'run_replace_or_original'
        ...k/packer/opt/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'key_func'
        ...ack/packer/opt/telescope.nvim/lua/telescope/mappings.lua:341: in function 'execute_keymap'
        [string ":lua"]:1: in main chunk

The same templates work if I am calling it using OverseerRun. Just not when I try to do something like :lua require("overseer").run_template({name="TheNAME"})

Could you please point me to the new signature of the run_template call? Or do I need to define templates differently than before?

stevearc commented 2 years ago

Apologies, I attempted to make it a transparent refactor, but I missed a callsite. Should be working now

ranjithshegde commented 2 years ago

That was very quick! Thank you. It works now!