Closed jaschenb closed 2 years ago
use the Treesitter provider with my own highlight definitions and not a colour scheme.
Could you show me an example?
Could you show me an example?
for example the highlight groups in the screenshots I posted are:
hi Constant guifg=#5f875f hi Function guifg=#af8700 hi TSVariable guifg=#993300 hi TSField guifg=#808000
only the string, which links to Function seems to be displayed correctly.
Please provide the line info by setting up ufo like
require('ufo').setup({
fold_virt_text_handler = function (virtText)
print(vim.inspect(virtText))
return virtText
end
})
and run TSCaptureUnderCursor
(nvim-treesitter/playground) under each word for the line.
okay the line I get is: { { "vim.api.nvim_create_autocmd(", "UfoFoldedFg" }, { "'Filetype'", 735 }, { ", {", "UfoFoldedFg" } }
and the nodes are: vim: @variable -> luaTSVariable -> TSVariable
api:
@variable -> luaTSVariable -> TSVariable
@field -> luaTSField -> TSField
nvim_create_autocommand:
@variable -> luaTSVariable -> TSVariable
@field -> luaTSField -> TSField
@function -> luaTSFunction -> TSFunction
'Filetype': @string -> luaTSString -> TSString
set termguicolors
I have that already and it isn't working with termguicolors on
okay your comment gave me an idea and now it works. I loaded ufo before I set termguicolors in my init files and then it doesn't work. I just moved it back now after I did that, now it works as inteded. Thanks for the help, but maybe it would help to mention that somewhere or maybe it's possible to check if termguicolors get used after ufo was loaded?
I loaded ufo before I set termguicolors in my init files.
No idea why you are doing that, that's not a regular use case.
maybe it's possible to check if termguicolors get used after ufo was loaded?
Not worth doing this feature, this plugin is compatible with v0.6.1 Neovim which handling highlight groups is a little painful.
Neovim version (nvim -v | head -n1)
NVIM v0.7.2
Operating system/version
macOS 11.5
How to reproduce the issue
I use the Treesitter provider with my own highlight definitions and not a colour scheme. When I close the fold not all of the nodes seem to get recognised correctly.
Expected behavior
The colour of the folded text gets displayed correctly
Actual behavior
This is the unfolded text:
and then here is the top line while folded: