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.24k stars 178 forks source link

feature: Enhanced Identification of `trouble.nvim` Mode #357

Closed tummetott closed 4 months ago

tummetott commented 8 months ago

Did you check the docs?

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

It would be valuable to determine the mode in which the trouble.nvim window is currently opened. For instance, I would like to display in my winbar whether the trouble window currently contains my quickfix list, location list, or workspace diagnostics. When I work with, for example, workspace diagnostics and my quickfix list simultaneously, and switch between them, it can be quite confusing not to have clear visibility into which one is currently displayed in the trouble window.

Describe the solution you'd like

Include information about the mode in the bufname

The filetype should remain consistent for all trouble windows.

When utilizing edgy.nvim, one could write a filter function that specifically targets buffers with e.g bufname == "ToubleQuickfix" and then assign a title like title = "Trouble Quickfix" to be shown in the winbar

Describe alternatives you've considered

Provide an API function such as require("trouble").get_mode()

Additional context

No response

folke commented 4 months ago

Check vim.w.trouble.mode

folke commented 4 months ago

only on v3