Closed 231tr0n closed 1 week ago
This is not an issue with 'mini.hues' (or any color scheme, for that matter). This is the effect of tree-sitter highlighting: as it is done with extmarks, if highlight group defines background color, it is used on top of the cursorline. You can check which highlight group overrides cursorline by executing :Inspect
in the target range.
This is not an issue with 'mini.hues' (or any color scheme, for that matter). This is the effect of tree-sitter highlighting: as it is done with extmarks, if highlight group defines background color, it is used on top of the cursorline. You can check which highlight group overrides cursorline by executing
:Inspect
in the target range.
But with tokyonight colorscheme, the same code works fine.
Running :Inspect
at the position of the cursor in screenshot shows the following:
Treesitter
- @none.svelte links to Normal svelte
As it links to Normal
highlight group, it defines background which overrides cursorline (as this is how extmarks with background work).
This comes from 'nvim-treesitter/nvim-treesitter' and which has the following its 'CONTRIBUTING.md': @none ; completely disable the highlight
. The 'mini.hues' module interprets "completely disable" as "disable both foreground and background" and does so by linking to Normal
.
This particular use of @none
comes from 'svelte' queries and seems intentional.
'folke/tokyonight.nvim' has different behavior because it ignores the @none
capture completely, which doesn't align with documentation in 'nvim-treesitter/nvim-treesitter'.
If you don't like this behavior, you can follow the Tokyonight route and add vim.api.nvim_set_hl(0, '@none', {})
after enabling 'mini.hues' based color scheme. A more elaborate approach is to define @none
to only have foreground from Normal
, but that is left as an exercise in how to use vim.api.nvim_get_hl()
.
Contributing guidelines
Module(s)
mini.hues
Description
cursorline in mini.hues is not highlighted properly in few lines in mini.hues. In some places it looks normal like below While in others it does not show properly
Neovim version
nightly latest
Steps to reproduce
With the above config open the file below with name *.svelte
Expected behavior
Cursorline should look uniform across all lines.
Actual behavior
Cursorline is not uniform across all lines.