-
Notifications
You must be signed in to change notification settings - Fork 54
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
🐞 Bug: highlight_groups custom groups stopped working #172
Comments
This is due to changes to how highlights are applied.
This is the new syntax. highlight_groups = {
{
output = function (hl)
return {
group_name = "Heading1Corner",
value = {
fg = hl.hex(hl.color("bg", { "MarkviewHeading1" }, nil, nil))
}
}
end
}
} Here's the function definitions. ---@param opt string Option to get, e.g. bg, fg
---@param colors string[] List of highlight groups to check into. Useful for groups that get inherited from multiple highlight groups.
---@param light any Value to return if the opt wasn't found and the background is "light".
---@param dark any Value to return if the opt wasn't found and the background is "dark".
---
---@return integer[] The R, G, B value
hl.color(opt, colors, light, dark)
---@param color integer[] The R, G, B values
---@return string The hexadecimal value of the color.
hl.hex(color)
Manually setting highlight groups is no longer recommended as it may overwrite the highlight groups provided by the colorscheme(assuming it supports this plugin). So, it will not be documented in the wiki. |
So the new update makes this broken. I am unable to figure out what to do since it wasnt documented. highlight_groups = {
{
output = function (hl)
return {
group_name = "MarkviewHeading1Corner",
value = { fg = hl.hex(hl.color("bg", { "MarkviewHeading1" }, nil, nil)) }
}
end
},
{
output = function (hl)
return {
group_name = "MarkviewHeading2Corner",
value = { fg = hl.hex(hl.color("bg", { "MarkviewHeading2" }, nil, nil)) }
}
end
},
{
output = function (hl)
return {
group_name = "MarkviewHeading3Corner",
value = { fg = hl.hex(hl.color("bg", { "MarkviewHeading3" }, nil, nil)) }
}
end
},
{
output = function (hl)
return {
group_name = "MarkviewHeading4Corner",
value = { fg = hl.hex(hl.color("bg", { "MarkviewHeading4" }, nil, nil)) }
}
end
},
{
output = function (hl)
return {
group_name = "MarkviewHeading5Corner",
value = { fg = hl.hex(hl.color("bg", { "MarkviewHeading5" }, nil, nil)) }
}
end
},
{
output = function (hl)
return {
group_name = "MarkviewHeading6Corner",
value = { fg = hl.hex(hl.color("bg", { "MarkviewHeading6" }, nil, nil)) }
}
end
}
}, Error Message
|
Structure for You also no longer receive So you will need something like this, highlight_groups = {
-- The property name is ZZ because we want to load this last.
["ZZ"] = function ()
local hl = require("markview.highlights");
local _o = {};
for h = 1, 6, 1 do
-- `hl.color()` → `hl.get_property()` as it can now get highlight group properties too
local bg = hl.get_property("bg", { "MarkviewHeading" .. h }, nil, nil);
if bg then
table.insert(_o, {
group_name = "MarkviewHeading" .. h .. "Corner",
-- `hl.hex()` → `hl.rgb_to_hex()` as the previous name wasn't obvious(because there's now HSL & Lab color functions too).
value = { fg = hl.rgb_to_hex(bg) }
});
end
end
return _o;
end
} |
Thank you brother. keep doing amazing. Thanks for the plugin. It has been great using it. |
Glad you stuck around! |
Before reporting:
Problem:
very recently the highlight_groups section, or more specifically the groups I added to it has stopped working.
I know before it worked just fine but I don't know which update might have broken that.
As you can see in the corner of the headers. it should have highlight same to the background
![スクリーンショット 2024-10-08 23 25 31](https://private-user-images.githubusercontent.com/98118238/374793938-aafc36df-d57d-4dab-b3ef-7d0699ade719.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MjU0MTcsIm5iZiI6MTczODkyNTExNywicGF0aCI6Ii85ODExODIzOC8zNzQ3OTM5MzgtYWFmYzM2ZGYtZDU3ZC00ZGFiLWIzZWYtN2QwNjk5YWRlNzE5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDEwNDUxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRkY2Y2NTVmZmMxYTc2NGRmYWZjYmQyYjI5NmYzNDVjODRmYjI0YjU4ZDk1ZWQwOGEyZTNhNmFkNDYwM2ZlY2YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.vxvydk3DyDOBjpfjqCWyFvhPPYzPestygq2y-_8OFLI)
Steps to reproduce the issue:
Expected behavior:
The corner of the headers should match the headers background
Neovim version:
NVIM v0.10.2 Build type: Release LuaJIT 2.1.1727870382
The text was updated successfully, but these errors were encountered: