Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
xzbdmw opened this issue May 18, 2024 · 7 comments · Fixed by #437
Closed
1 task done

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

xzbdmw opened this issue May 18, 2024 · 7 comments · Fixed by #437

Comments

@xzbdmw
Copy link

xzbdmw commented May 18, 2024

Did you check the docs?

  • I have read all the trouble.nvim 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

@xzbdmw xzbdmw changed the title feature: Can we not using floating window for preview? feature: Can we use real buffer for preview? May 18, 2024
@yavorski
Copy link

yavorski commented May 25, 2024

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

@xzbdmw
Copy link
Author

xzbdmw commented May 25, 2024

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

@Mado13
Copy link

Mado13 commented May 28, 2024

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

@yavorski
Copy link

yavorski commented May 28, 2024

@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
Copy link
Author

xzbdmw commented May 28, 2024

@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
Copy link
Owner

folke commented May 30, 2024

@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
Copy link
Owner

folke commented May 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants