trouble.nvim icon indicating copy to clipboard operation
trouble.nvim copied to clipboard

Hooks for bufresize

Open lostl1ght opened this issue 2 years ago • 1 comments

I'd like to integrate Bufresize plugin.

This snippet from readme works. Bufresize is triggered when I use my defined function.

However, as close and jump_close are handled internally by Trouble, Bufresize is not triggered.

Is there a way to make it work? If not it would be cool to introduce hooks before and after opening/closing Trouble.

lostl1ght avatar Sep 13 '22 18:09 lostl1ght

seems it can be done easily in user config:

  • add autocmd for ft=trouble that add your custom actions
  • name the action you desired as my_close
my_close = function()
    -- pre hook here
    require'trouble'.action('close')
    -- post hook here
end

haolian9 avatar Sep 13 '22 21:09 haolian9