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: Interaction with oil.nvim buffers #397

Closed Rubenduburck closed 2 months ago

Rubenduburck commented 3 months ago

Did you check the docs?

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

When opening any trouble panel with results, if I leave the buffer to go to an oil buffer (file explorer) and then go into the still loaded trouble panel and attempt to load a preview for any of the items, Trouble fails with error trouble/view/preview.lua:91: attempt to index field 'preview' (a nil value). These errors continue every 100ms as long as Trouble is running.

Describe the solution you'd like

Would like the Trouble panel to load the preview as it does normally

Describe alternatives you've considered

The only way around this is to make sure not to enter a Trouble panel whenever in oil.nvim.

Additional context

No response

folke commented 3 months ago

Development on the main branch is EOL.

Trouble has been rewritten and will be merged in main soon.

This issue/feature either no longer exists or has been fixed/implemented on dev.

For more info, see https://github.com/folke/trouble.nvim/tree/dev

Rubenduburck commented 3 months ago

Development on the main branch is EOL.

Trouble has been rewritten and will be merged in main soon.

This issue/feature either no longer exists or has been fixed/implemented on dev.

For more info, see https://github.com/folke/trouble.nvim/tree/dev

Forgot to mention, I'm on dev. Did not have this problem before dev.

folke commented 3 months ago

trouble/view/preview.lua does not exist on dev. So you're not on dev or at least didnt update with lazy or your package manager

Rubenduburck commented 3 months ago

trouble/view/preview.lua does not exist on dev. So you're not on dev or at least didnt update with lazy or your package manager

isn't it here?

Maybe I'm missing something

folke commented 3 months ago

Yes, sorry, didnt check that good enough :)

You probably only have an oil window and a troubke window? No windows with regular buffers?

That's what's causing the error.

I'll have to see how to properly deal with this.

I'm leaving on a vacation in half an hour though, so will be for in a week or two.

Rubenduburck commented 3 months ago

Yes, sorry, didnt check that good enough :)

You probably only have an oil window and a troubke window? No windows with regular buffers?

That's what's causing the error.

I'll have to see how to properly deal with this.

I'm leaving on a vacation in half an hour though, so will be for in a week or two.

Yeah that's exactly right, trouble window + oil window.

Enjoy!

maxbol commented 2 months ago

+1, would love to see this fixed :)

folke commented 2 months ago

Should be fixed now. Let me know if it still gives issues.