folke / trouble.nvim

🚦 A pretty diagnostics, references, telescope results, quickfix and location list to help you solve all the trouble your code is causing.
Apache License 2.0
5.15k stars 173 forks source link

feature: events for opening, closing, and resizing Trouble window? #365

Closed j-hui closed 1 month ago

j-hui commented 7 months ago

Did you check the docs?

Is your feature request related to a problem? Please describe.

Hey there πŸ‘‹ I'm the author for fidget.nvim.

I'm trying to play nice with other plugins that open windows: I'd like Fidget to avoid rendering over those windows (or at least do something to avoid unreadable output). See https://github.com/j-hui/fidget.nvim/issues/163 for an example of this issue with nvim-tree.

Fidget suffers the same problem with Trouble windows.

Describe the solution you'd like

I'd like Trouble to expose some events that fire when the Trouble window is opened, closed, and resized (similar to what nvim-tree does).

Describe alternatives you've considered

I considered listening for Neovim's WinNew and WinResize events, but it would be very difficult to distinguish the events fired for windows that Fidget should render over (e.g., another user-created text buffer) versus the ones it shouldn't (e.g., a Trouble window).

Additional context

No response

j-hui commented 1 month ago

@folke I saw you marked this as completed; is the new feature documented anywhere? Thanks!

folke commented 1 month ago

You can check for ft = trouble There's no need for trouble to generate custom events