fix: invalid character in group name 0.7 neovim version (#18)

This commit is contained in:
2022-10-21 03:08:58 -03:00
parent 3949fe8888
commit 9e940a1193
2 changed files with 116 additions and 96 deletions

View File

@@ -198,6 +198,10 @@ hl.plugins.treesitter = {
commentTSDanger = hl.predef.RedItalic,
commentTSNote = hl.predef.BlueItalic,
commentTSWarning = hl.predef.YellowItalic,
}
if u.check_min_version(0, 8, 0) then
hl.plugins.treesitter = {
["@comment"] = { link = "Comment" },
["@error"] = { link = "Error" },
["@none"] = { bg = "NONE", fg = "NONE" },
@@ -268,9 +272,9 @@ hl.plugins.treesitter = {
["@tag"] = { link = "Tag" },
["@tag.attribute"] = { link = "Identifier" },
["@tag.delimiter"] = { link = "Delimiter" },
}
}
hl.plugins.cmp = {
hl.plugins.lsp_semantic_tokens = {
LspNamespace = { link = "@namespace" },
LspType = { link = "@type" },
LspClass = { link = "@type" },
@@ -295,7 +299,8 @@ hl.plugins.cmp = {
LspOperator = { link = "@operator" },
LspDecorator = { link = "@symbol" },
LspDeprecated = { link = "@text.strike" },
}
}
end
hl.plugins.cmp = {
CmpItemKindDefault = { fg = p.blue, bg = p.none },

View File

@@ -38,4 +38,19 @@ function U.color_gamma(hex, gamma)
return string.format("#%02x%02x%02x", r, g, b)
end
function U.check_min_version(major, minor, patch)
local version = vim.version()
local current_major = version.major
local current_minor = version.minor
local current_patch = version.patch
if current_major > major then
return true
elseif current_major == major and current_minor > minor then
return true
elseif current_major == major and current_minor == minor and current_patch >= patch then
return true
end
return false
end
return U