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

Close Trouble window

Open jmiln opened this issue 2 years ago • 2 comments

When I use :TroubleClose or :TroubleToggle, it closes the window, but then pops back up whenever I pull out of insert mode next time.

Is there a way to just make it go away until I want it back?

jmiln avatar Jul 11 '22 20:07 jmiln

were you having auto_open = true?

haolian9 avatar Sep 13 '22 22:09 haolian9

Apologies for the delayed reply, I do have that enabled, yes. I think what I want it to do is disable until I re-enable it. I'm pretty sure whatever I had used in the past (Probably ALE + Coc or something) had that functionality, as well as only updating/ checking on save, but that seems to be a built-in lsp thing for neovim that I haven't seen any way of working around yet.

jmiln avatar Sep 19 '22 23:09 jmiln

Hmm, @jmiln could you elaborate how that would work? Trouble would automatically open when you have diagnostics but calling :TroubleClose or :TroubleToggle would disable that? How would you re-enable it then? Just trying to understand the use case.

okuuva avatar Oct 03 '22 13:10 okuuva

Looking back, close makes less sense for what I was thinking of, but it looks like ALE was the one I was remembering having enable/disable/toggle. https://github.com/dense-analysis/ale/blob/a33960eb51b638f232dff71cfeac5ede87b38312/doc/ale.txt#L3679

It's just a bit frustrating when you close it because I don't need it taking up space then it pops back up a few seconds later when you start working again, especially on small split windows

jmiln avatar Oct 03 '22 14:10 jmiln

Is there a particular reason why you just don't set auto_open = false?

okuuva avatar Oct 03 '22 14:10 okuuva

Mainly just that I like it popping up and telling me when I do something dumb/ break something, and that's what I'd been used to previously

jmiln avatar Oct 04 '22 04:10 jmiln

Would TroubleDisable and TroubleEnable commands be enough? I'm not the maintainer but to me this sounds a very niche use case and I'm not sure adding the logic to TroubleToggle would be worth the added complexity especially in the configuration.

okuuva avatar Oct 04 '22 07:10 okuuva

That'd be perfect, actually.

I'd mainly just been hoping there was something already there that I was missing, rather than making more work for anyone.

jmiln avatar Oct 04 '22 21:10 jmiln

I'll try to find time to create a PR implementing this sometime next week but given that @folke has been very inactive in this project lately it's probably not gonna be merged any time soon.

okuuva avatar Oct 05 '22 06:10 okuuva

Sounds good, thanks for your input on this, hadn't really thought through it previously apparently

jmiln avatar Oct 05 '22 19:10 jmiln

I think I'm actually just going to switch to not having it open automatically, and map something to toggle it, since that'll likely be a cleaner workflow in the long run

jmiln avatar Oct 05 '22 22:10 jmiln

I agree. This is probably obivous but in case someone else is having similar workflow hicups: there's plenty of plugins offering visual cues about available diagnostics in buffers/workspace like bufferline, lualine, NvimTree to name a few. Having TroubleToggle bound to some easy to access keyboard shortcut and opening it when you see you have diagnostics available but it's not immediately obvious why is IMO a very smooth workflow. I personally find the auto_open option noisy.

On October 6, 2022, Peachy74 @.***> wrote:

I think I'm actually just going to switch to not having it open automatically, and map something to toggle it, since that'll likely be a cleaner workflow in the long run

— Reply to this email directly, view it on GitHub <https://github.com/folke/trouble.nvim/issues/193#issuecomment- 1269044244>, or unsubscribe <https://github.com/notifications/unsubscribe- auth/AAVMSNCDQPXLWMGDCHRSMZDWBX5H5ANCNFSM53IYYH3A>. You are receiving this because you commented.Message ID: @.***>

okuuva avatar Oct 06 '22 04:10 okuuva