-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Telescope syntax highlighting is not working until I open a file #2084
Comments
unable to reproduce! make sure you have these tsparsers installed : html css javascript typescript tsx |
I verified just now with |
So I backed up my custom dir and reinstalled NvChad with the example custom configuration and I still see the issue :/ And it's the same situation as before: only Telescope has the broken highlighting, but everything else works. And if I open another file then open Telescope, it works fine |
thats really strange man, i cant reproduce it at all! |
I can reproduce the above error on a blank buffer(only on startup); however, this is due to the nvim-treesitter plugin not being loaded until a file is opened. This is due to lazy loading configuration for nvim-treesitter. My suspicion is you are experiencing this aswell. To confirm, run |
@vandenng nvimtree should still load on module regardlessly ! because telescope loads it |
@vandenng Ah interesting, yeah that does work! |
I'm unable to reproduce . Are you all using neovim v0.10? simplescreenrecorder-2023-06-06_05.30.39.mp4 |
Interesting... Here is some info regarding my setup: ![]() ![]() |
I'm on nvim v0.9 and running the latest version of NvChad 2.0 on Pop OS 22.04 LTS, although I do have the exact same setup on another machine where I can't reproduce the issue, so there might be something else that could be affecting it |
try vanilla nvchad |
@Shunseii Try adding this to
|
i cant reproduce this issue at all... Please make sure you all have proper tsparsers installed. lazy.nvim autoloads a plugin on whenever their module gets called. Telescope whenever opened will also show the file preview which underhood still runs some code to call treesitter probably so nvim-treesitter too :/ vid.mp4 |
I have the some problem, adding "nvim-treesitter/nvim-treesitter" as dependencies of "nvim-telescope/telescope.nvim" fixes the problem. If telescope need nvim-treesitter, maybe we should explicitly declare that? I can make a PR if you like to accept. |
are you using latest version of neovim? like the v0.10 one |
neovim v0.9.1 |
It seems like this is a v0.9.x issue only. Not sure what changed in v0.10.x that prevents the issue from happening but I'm experiencing the same issue on 2 different machines (one running macOS, one running arch) both on v0.9.1 Either the fix above getting merged in or just having those affected manually add that change until we all get on a v0.10.x version. |
Fix Telescope syntax highlighting is not working until open a file NvChad#2084
@siduck Given that there's a nice workaround, I'm happy to close the issue -- should we keep open to discuss repro steps or fine to close? |
i wont close this yet, provide steps to reproduce , make a video with clean nvchad installation. If im able to reproduce it too then i'll add your change or you can make a PR :) |
Sounds good :) I'll try to get to this today or tomorrow! |
repro.webmSteps:
Let me know if I can add any additional info that could help out or if I missed something ! |
thanks @Shunseii i can reproduce it too now. it didnt reproduce in my config because it had this plugin So whenever I open telescope, i'll be in insert mode right? at that moment this plugin gets loaded and this plugin is related to treesitter so it calls some treesitter modules which then loads treesitter plugin. Btw this telescope issue we're facing didnt exist before, recently telescope started using vim.treesitter** stuff instead of calling the treesitter plugin directly i think so i guess I'll merge your pr! done : c2a0bb1 |
Fix Telescope syntax highlighting is not working until open a file NvChad#2084
Fix Telescope syntax highlighting is not working until open a file NvChad#2084
Describe the bug
The syntax highlighting in the Telescope window is not respecting my configuration and uses the default, high-contrast colours when I first open it after opening a project. However, if I open a file and then open Telescope again, the syntax highlighting is back to normal. It's happening with all the languages that I've checked.
To Reproduce
Steps to reproduce the behavior:
nvim
<leader>ff
Expected behavior
The syntax highlighting should be consistent and correct in the Telescope window.
Screenshots
![image](https://private-user-images.githubusercontent.com/20803729/243157671-dc67d1a5-ac91-44b7-9e9b-0ae0b05e3b0d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk5MzgyNTIsIm5iZiI6MTcxOTkzNzk1MiwicGF0aCI6Ii8yMDgwMzcyOS8yNDMxNTc2NzEtZGM2N2QxYTUtYWM5MS00NGI3LTllOWItMGFlMGIwNWUzYjBkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzAyVDE2MzIzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU3ZDUxMGZiZDk5ZDg0ZjNhNWU2ZGMwMzNlMjc4ZmIwMjdhNzYxOWJlZjQyY2VjYzJhYWI3NmE1M2E2YmEyNDkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.74B4DPCZvx15o2br862Bsfr3sDx1V8cUyFJZJ-edVlY)
When I initially open Telescope before opening any project files (shows the broken syntax highlighting)
After I open some file in the project then open Telescope again (shows the expected highlighting):
![image](https://private-user-images.githubusercontent.com/20803729/243157735-840444ba-8e68-4667-b005-cd94e0686161.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk5MzgyNTIsIm5iZiI6MTcxOTkzNzk1MiwicGF0aCI6Ii8yMDgwMzcyOS8yNDMxNTc3MzUtODQwNDQ0YmEtOGU2OC00NjY3LWIwMDUtY2Q5NGUwNjg2MTYxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzAyVDE2MzIzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE1MzYxYTViMGFhYTY4YTgzYWQ4YjQyZTVhOGRmNGFlMmY1Nzg1ZjYzOTQ1NzM2MTYyNjlmOTQ4NmE2NzAyNDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Yb00nAeIAz10YKd9rqAvPmUZiO2KfG_srGuBvef71w0)
Desktop (please complete the following information):
Additional context
I have the exact same setup on my laptop (issue occurs on my desktop) in terms of OS and NvChad configuration and I don't see it on my laptop. In fact, I wasn't even seeing this on my desktop until I installed the following LSPs with Mason by adding the following lines to
ensure_installed
and then:MasonInstallAll
(since I realized I didn't have them installed nor explicitly required in my config):I've also copied over the entire
custom/
directory from my laptop to my desktop (although they should've been identical from the start) to double-check, but I'm facing the same issue.I suspect I just missed a step somewhere when I was setting it up again on my desktop (which I did after my laptop) rather than this being a bug, but I'm really at a loss as to how I can debug this :(
The text was updated successfully, but these errors were encountered: