compiler.nvim
compiler.nvim copied to clipboard
Can we jump to the task output by default?
First of all, thank you so much for an awesome plugin!
I'd like to build and run and have the active Overseer item automatically be the task output without needing to navigate to it manually.
See the attached video to see what I mean: https://github.com/Zeioth/compiler.nvim/assets/37928/ff4a9890-de92-4bb7-8dd0-e412494c5210
Hey @aaronmcadam I realize, and what you say makes total sense. It's not trivial to achieve though, as we use overseer.nvim as task runner. I don't think the orchestrator strategy we use has a option for this.
We can't really use pure tasks instead of a orchestrator because most of our cases of use need to run tasks secuencially like compile → run, which requires the overseer orchestrator.
Give me some time to research alternatives. This would be actually cool to achieve. I realize if you need to compile often, it can tedious having to press down every time.
@Zeioth thanks for the background info, that explains the subgrouping very well. For recompiling, it's not too bad because I can set the task to watch mode to rerun when I change the code. So I'm happy for now. Let me know if I can help you test out any ideas you have though!
Now that I remember: this was the original behavior of this plugin actually. The change has been upstream on overseer in how it order orchestrated tasks. I'm gonna ask Steve.
EDIT: Tracking https://github.com/stevearc/overseer.nvim/discussions/262
PR sent, waiting for feedback. https://github.com/stevearc/overseer.nvim/pull/299
Alternative approach added to overseer:
-- define the componen `custom_tasklist`.
-- when a task start, auto open the tasklist and focus the first child.
require("overseer").register_alias("custom_tasklist", {
"default",
{ "open_output", on_start = true, on_complete = "never" },
})
We add that to init, and then we can use it on the backend like in the next example
local task = overseer.new_task({
name = "- Lua interpreter",
strategy = { "orchestrator",
tasks = {{ "shell", name = "- Run this file → " .. current_file,
cmd = "lua " .. current_file .. -- run (interpreted)
" && echo " .. current_file .. -- echo
" && echo \"" .. final_message .. "\"",
components = { "custom_tasklist" }
},},},})
Hopefully, we can convince steve to make this the default behavior, but even if we can't, at least this UX issue is fixable now, and we should be able to ship it in the next version.
Thanks for the hard work and collaboration on this @Zeioth @stevearc ❤️