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.44k stars 177 forks source link

feature: Can we use real buffer for preview? #435

Closed xzbdmw closed 4 months ago

xzbdmw commented 4 months ago

Did you check the docs?

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

I v2 the auto_preview actually opens the buffer and set cursor to location, while in v3 there is only syntax highlight in preview, which makes some plugin that reacts to bufenter no longer works, for example, gitsigns don't work on preview, and builtin diagnose right align to cursorline is not showing too. I have to actually type enter.

For example, it would be much better If I can edit the text directly in split preview without having to enter main window, by that way I can see two buffer at the same time and my eyes don't need to jump from right preview to main window.

Describe the solution you'd like

Actually open the buffer and set cursor

Describe alternatives you've considered

Hmm

Additional context

No response

yavorski commented 4 months ago

Hmm, for some reason I don't even have syntax highlight. Previews are just white text?

xzbdmw commented 4 months ago

@yavorski highlights comes from treesitter.start, you can remove that pcall to see if there are errors

Mado13 commented 4 months ago

well it will also be nice to be able to edit inside of preview if its a real buffer

yavorski commented 4 months ago

@yavorski highlights comes from treesitter.start, you can remove that pcall to see if there are errors

@xzbdmw No difference, there is no highlight, screenshot attached. Trouble v2 and Telescope references are working fine though.

trouble-white-text-preview

xzbdmw commented 4 months ago

@yavorski highlights comes from treesitter.start, you can remove that pcall to see if there are errors

@xzbdmw No difference, there is no highlight, screenshot attached. Trouble v2 and Telescope references are working fine though.

trouble-white-text-preview

Then it maybe a bug, you can file a issue

folke commented 4 months ago

@yavorski the issue you had was specifically for unloaded typescript files, and was caused due to a quirk in how the ftdetect for typescript works in Neovim.

I was able to fix it.

folke commented 4 months ago

You can now set opts.preview.scratch = false to always load the preview in a real buffer