You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today I found out that synID() which was used in cat mode does not see all highlights added to a position. I will have to refactor cat mode to use vim.inspect_pos()
You are welcome to work on it. I currently do not have the time to fix it / I can not give an ETA.
As noted above it would be necessary to refactor the code to use vim.inspect_pos() instead of synID(). I previously had a short look at the output of that function and it seems it yields all different extmarks and treesitter tokens like this:
The main question I had (and did not have the time to figure out) was in which order these different highlight groups should be stacked/merged to produce the final display attributes.
On Wed, 20 Mar 2024 at 14:18, Lucas Hoffmann ***@***.***> wrote:
You are welcome to work on it. I currently do not have the time to fix it
/ I can not give an ETA.
As noted above it would be necessary to refactor the code to use
vim.inspect_pos() instead of synID(). I previously had a short look at
the output of that function and it seems it yields all different extmarks
and treesitter tokens like this:
{
buffer = 14,
col = 3,
extmarks = { {
col = 2,
end_col = 10,
end_row = 112,
id = 25,
ns = "illuminate.highlight",
ns_id = 20,
opts = {
end_col = 10,
end_right_gravity = false,
end_row = 112,
hl_eol = false,
hl_group = "IlluminatedWordText",
hl_group_link = "IlluminatedWordText",
ns_id = 20,
priority = 199,
right_gravity = true
},
row = 112
} },
row = 112,
semantic_tokens = {},
syntax = {},
treesitter = { {
capture = "string",
hl_group = ***@***.***",
hl_group_link = "Constant",
lang = "yaml",
metadata = {}
}, {
capture = "property",
hl_group = ***@***.***",
hl_group_link = "Identifier",
lang = "yaml",
metadata = {}
} }
}
The main question I had (and did not have the time to figure out) was in
which order these different highlight groups should be stacked/merged to
produce the final display attributes.
—
Reply to this email directly, view it on GitHub
<#63 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASPPZ4JQVJ2XVSGXHGWRAZTYZGLEVAVCNFSM5Q25PRWKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBQHE3DQNBZHA2Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
Hey folks — just to let to whoever is interested to know — I have managed to add treesitter syntax highlighting support. The only piece that's missing is a way to determine if the treesitter resolver function that I wrote should be used instead of built-in synID, so that compatibility with regular syntax highlighting is preserved.
As soon as this is done followed by some testing — I will submit a pull request.
Reacted by Michal Kielbowicz, Oscar Fu, Kyle King, Frestein ☁️ and Bas van den Wollenberg
Activity
lucc commentedon Jun 13, 2022
Sorry, somehow I missed this issue. I just checked and I can reproduce it.
MatthiasGrandl commentedon Dec 2, 2022
Can also confirm. Also tabstop settings are ignored in cat mode, but work fine in pager mode.
lucc commentedon Sep 29, 2023
Today I found out that synID() which was used in cat mode does not see all highlights added to a position. I will have to refactor cat mode to use vim.inspect_pos()
Ref https://vi.stackexchange.com/a/41586/18062
night0721 commentedon Mar 20, 2024
Would this be fixed any time soon?
lucc commentedon Mar 20, 2024
You are welcome to work on it. I currently do not have the time to fix it / I can not give an ETA.
As noted above it would be necessary to refactor the code to use
vim.inspect_pos()instead ofsynID(). I previously had a short look at the output of that function and it seems it yields all different extmarks and treesitter tokens like this:{ buffer = 14, col = 3, extmarks = { { col = 2, end_col = 10, end_row = 112, id = 25, ns = "illuminate.highlight", ns_id = 20, opts = { end_col = 10, end_right_gravity = false, end_row = 112, hl_eol = false, hl_group = "IlluminatedWordText", hl_group_link = "IlluminatedWordText", ns_id = 20, priority = 199, right_gravity = true }, row = 112 } }, row = 112, semantic_tokens = {}, syntax = {}, treesitter = { { capture = "string", hl_group = "@string.yaml", hl_group_link = "Constant", lang = "yaml", metadata = {} }, { capture = "property", hl_group = "@property.yaml", hl_group_link = "Identifier", lang = "yaml", metadata = {} } } }The main question I had (and did not have the time to figure out) was in which order these different highlight groups should be stacked/merged to produce the final display attributes.
night0721 commentedon Mar 20, 2024
adeg commentedon Mar 31, 2024
Hey folks — just to let to whoever is interested to know — I have managed to add treesitter syntax highlighting support. The only piece that's missing is a way to determine if the treesitter resolver function that I wrote should be used instead of built-in synID, so that compatibility with regular syntax highlighting is preserved.
As soon as this is done followed by some testing — I will submit a pull request.
Freed-Wu commentedon Mar 5, 2026
If you want to cat a file with treesitter's syntax hightlight, there exist some alternatives: