Adding components #7
-
Firstly, I have finally gotten around to defining and bundling templates (using What I am not able to figure out, if there is a way to pass any component while defining a template? for example something like local pseudo_template = {
name = "foo",
desc = "something",
components = {"here i pass it as list"} or function(_) end
} If not, then what is the prefered way of attaching a component to a specific template or task? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Templates have a overseer.nvim/lua/overseer/task.lua Lines 41 to 49 in 57b1d3d So your template could look like this: local my_template = {
name = "My template",
params = {},
builder = function(params)
return {
cmd = "ls -l",
components = {'default', 'my_custom_component'},
}
end
} If you need to set the components on the task based on configuration passed to your template, then you can add params to the template and use those in the builder to create the list of components. |
Beta Was this translation helpful? Give feedback.
Templates have a
builder
function that returns aoverseer.TaskDefinition
. This is passed in directly tooverseer.new_task
. This could probably be documented better, but the type can be found here:overseer.nvim/lua/overseer/task.lua
Lines 41 to 49 in 57b1d3d
So your template could look like this: