Comments (6)
Thanks for the fixes! I've confirmed that I can't reproduce those bugs anymore.
Here's what I'm seeing now, using the same test config as before:
hlgroups = {
TSFunction = {fg = "${orange}"},
},
filetype_hlgroups = {
yaml = {
TSField = { fg = "${red}" },
},
javascript = {
TSFunction = { fg = "${green}" },
},
php = {
TSFunction = { fg = "${purple}" },
},
ruby = {
TSFunction = { fg = "${blue}" },
}
},
First, syntax highlighting in Telescope's preview uses the highlight groups of the filetype in the buffer that was open when Telescope was called rather than the filetype of the file being previewed.
For example:
- Given a JavaScript hlgroup that sets the TSFunction fg to green
- And a Ruby hlgroup that sets the TSFunction fg to red
- When I open a JS file
- And then I open the Telescope file finder and preview a Ruby file
- The function names in the preview window should be red, but are actually green
Demo:
Second, if I switch to a buffer that uses the non-file-type-specific hl group (the orange one, above), and then back to one that matches a rule for a specific file type (e.g., PHP), the PHP file will use the generic color instead of the PHP color. If I then switch to a file that has a specific rule (e.g., JS) and back to PHP, the correct colors are shown.
Demo:
from onedarkpro.nvim.
@mmirus I've fixed the two issues you spotted in the latest commit. Please let me know what you think.
The solution to the floating windows was to ignore specific filetypes and buffer types.
from onedarkpro.nvim.
That is some epic testing! Thanks so much. I shall see if I can resolve!
from onedarkpro.nvim.
Struggling to solve the Telescope
previewer issues. Will open an issue on their side and ask for help. Seems Telescope reads the file asynchronously with vim.loop.fs_
and there is no way to detect when you preview a ruby
then a js
file.
Key question: how much of a nuisance would it be for you?
from onedarkpro.nvim.
You got it!
from onedarkpro.nvim.
It probably wouldn't be much of an issue initially, as I don't have many file type specific rules in mind. If that grew over time then it would become more likely for the preview to differ significantly in projects with multiple languages.
From my perspective it's a matter of preference for you if it's a blocker or not. Waiting to add the feature means folks have to accept the trade-off of not being able to do file type specific rules. Releasing it with this bug means they can choose whether they prefer limited highlighting or buggy previewing. Of course that could open you up to complaints. So it's just down to what you want to do!
from onedarkpro.nvim.
Related Issues (20)
- [Bug]: Custom queries override sane defaults HOT 2
- [Bug]: Can't override colors HOT 8
- Highlight DiffChange HOT 1
- [Bug]: missing comma in minimal config for bug reports
- [Bug]: @lsp.type.comment.lua overrides @text.uri.comment HOT 10
- [Bug]: Onedarkpro's highlights get overriden by typescript-language-server. HOT 15
- [Bug]: fixme/todos from comment parser overriden by semantic tokens in lua HOT 10
- Built-in linking takes precedence over the values set in the setup function HOT 2
- [Bug]: Very low contrast/unreadable text with light variant of the colorscheme HOT 11
- [Bug]: Error when setting `Comment` highlights (for the first time)? HOT 6
- [Bug]: Rust `#![attributes]` are not highlighted HOT 3
- [Bug]: onedark_dark floating panels indistinguishable HOT 8
- [Bug]: No Markdown Highlighting HOT 5
- [Bug]: lualine background has disappeared HOT 3
- [Bug]: missing treesitter-based highlight for JS/TS properties after breaking nvim-treesitter update HOT 5
- [Bug]: TS/TSX treesitter errors + broken syntax highlighting with onedark and latest nvim-treesitter HOT 6
- [Bug]: No highlight for selected complition in nvim-cmp with onedark_dark. HOT 4
- [Bug]: Change highlight on yank doesn't work. HOT 6
- [Bug]: Not an editor command: require("onedarkpro").setup HOT 3
- [Bug]: Transparent background not applied HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onedarkpro.nvim.