-
Notifications
You must be signed in to change notification settings - Fork 62
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 request] syntax highlighting in file preview #36
Comments
Of course we can also change the code in nvim-cmp so that this issue can be closed right after that. |
I don't want to create new pseudo buffer (it has big side effect). |
Yes you are right. It doesn't have a function that can return the |
feat: syntax highlighting in preview (#36)
And I also viewed the code and came up with a naive idea to implement this.
Since the
&ft
of preview window is always markdown, so we can't change&ft
(am I right?). But the preview content is actually a markdown code block, so we can make use of that.Create a new buffer which is named after the file name, check the
&ft
of that buffer, and delete that buffer. The&ft
is what we want.Note: for some unknown reason, treesitter highlight is not available, but the regex-based highlight is loaded.
A better solution is greatly appreciated.
The text was updated successfully, but these errors were encountered: