Closed NicoElbers closed 4 weeks ago
If it's an action you want to execute from within the trouble window, then you can already do that. See the config for the two filtering examples.
If not, you can just add new actions to require('trouble.config.actions').actions
Or you can do any of these:
-- pass an action function as key
require("trouble")[function()
dd("foo")
end]({ mode = "diagnostics" })
-- open trouble and do an action
local view = require(trouble).open(opts)
if view then
view:action(action, opts) -- action is a string or function like in the actions
end
-- just use the trouble api
local view = require(trouble).open(opts)
if view then
view:wait(function()
view.win:focus()
end)
end
Ah, I completely missed this. Thank you for the quick reply!
Docs are missing on these things. Will write some soon :)
Did you check the docs?
Is your feature request related to a problem? Please describe.
As far as I've found, it's currently not possible to combine folding a node and the "jump_close" functionality
Describe the solution you'd like
Adding the below code after "jump_close", "jump_split" and "jump_vsplit" here
Describe alternatives you've considered
Alternatively allow users to create their own actions, this would be more flexible but it also may be a little overkill.
Additional context
No response