Skip to content

Commit

Permalink
fix(ui): fix highlight group name prefixes (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
williamboman authored Jul 8, 2022
1 parent 976aa4f commit 96294ce
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
8 changes: 4 additions & 4 deletions lua/mason/ui/components/json-schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ local function JsonSchema(pkg, schema_id, state, schema, key, level, key_width,
},
{
vim.json.encode(schema.default),
property_type_highlights[type] or "NvimInstallerMuted",
property_type_highlights[type] or "MasonMuted",
},
},
}
Expand All @@ -145,10 +145,10 @@ local function JsonSchema(pkg, schema_id, state, schema, key, level, key_width,
return { { line, "Comment" } }
end, vim.split(schema.description or "No description available.", "\n"))

local type_highlight = property_type_highlights[type] or "NvimInstallerMuted"
local type_highlight = property_type_highlights[type] or "MasonMuted"

local table_rows = {
{ { "type", "NvimInstallerMuted" }, { type, type_highlight } },
{ { "type", "MasonMuted" }, { type, type_highlight } },
}

if vim.tbl_islist(schema.enum) then
Expand All @@ -158,7 +158,7 @@ local function JsonSchema(pkg, schema_id, state, schema, key, level, key_width,
enum_description = "- " .. schema.enumDescriptions[idx]
end
table_rows[#table_rows + 1] = {
{ idx == 1 and "possible values" or "", "NvimInstallerMuted" },
{ idx == 1 and "possible values" or "", "MasonMuted" },
{ vim.json.encode(enum), type_highlight },
{ enum_description, "Comment" },
}
Expand Down
54 changes: 27 additions & 27 deletions lua/mason/ui/palette.lua
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
local M = {}

M.highlight_groups = {
NvimInstallerHeader = { bold = true, fg = "#222222", bg = "#DCA561" },
NvimInstallerHeaderSecondary = { bold = true, fg = "#222222", bg = "#56B6C2" },
MasonHeader = { bold = true, fg = "#222222", bg = "#DCA561" },
MasonHeaderSecondary = { bold = true, fg = "#222222", bg = "#56B6C2" },

NvimInstallerHighlight = { fg = "#56B6C2" },
NvimInstallerHighlightBlock = { bg = "#56B6C2", fg = "#222222" },
NvimInstallerHighlightBlockBold = { bg = "#56B6C2", fg = "#222222", bold = true },
MasonHighlight = { fg = "#56B6C2" },
MasonHighlightBlock = { bg = "#56B6C2", fg = "#222222" },
MasonHighlightBlockBold = { bg = "#56B6C2", fg = "#222222", bold = true },

NvimInstallerHighlightSecondary = { fg = "#DCA561" },
NvimInstallerHighlightBlockSecondary = { bg = "#DCA561", fg = "#222222" },
NvimInstallerHighlightBlockBoldSecondary = { bg = "#DCA561", fg = "#222222", bold = true },
MasonHighlightSecondary = { fg = "#DCA561" },
MasonHighlightBlockSecondary = { bg = "#DCA561", fg = "#222222" },
MasonHighlightBlockBoldSecondary = { bg = "#DCA561", fg = "#222222", bold = true },

NvimInstallerLink = { link = "NvimInstallerHighlight" },
MasonLink = { link = "MasonHighlight" },

NvimInstallerMuted = { fg = "#888888" },
NvimInstallerMutedBlock = { bg = "#888888", fg = "#222222" },
NvimInstallerMutedBlockBold = { bg = "#888888", fg = "#222222", bold = true },
MasonMuted = { fg = "#888888" },
MasonMutedBlock = { bg = "#888888", fg = "#222222" },
MasonMutedBlockBold = { bg = "#888888", fg = "#222222", bold = true },

NvimInstallerError = { fg = "#f44747" },
MasonError = { fg = "#f44747" },

NvimInstallerHeading = { bold = true },
MasonHeading = { bold = true },
}

local function hl(highlight)
Expand All @@ -31,19 +31,19 @@ end

-- aliases
M.none = hl ""
M.header = hl "NvimInstallerHeader"
M.header_secondary = hl "NvimInstallerHeaderSecondary"
M.muted = hl "NvimInstallerMuted"
M.muted_block = hl "NvimInstallerMutedBlock"
M.muted_block_bold = hl "NvimInstallerMutedBlockBold"
M.highlight = hl "NvimInstallerHighlight"
M.highlight_block = hl "NvimInstallerHighlightBlock"
M.highlight_block_bold = hl "NvimInstallerHighlightBlockBold"
M.highlight_block_secondary = hl "NvimInstallerHighlightBlockSecondary"
M.highlight_block_bold_secondary = hl "NvimInstallerHighlightBlockBoldSecondary"
M.highlight_secondary = hl "NvimInstallerHighlightSecondary"
M.error = hl "NvimInstallerError"
M.heading = hl "NvimInstallerHeading"
M.header = hl "MasonHeader"
M.header_secondary = hl "MasonHeaderSecondary"
M.muted = hl "MasonMuted"
M.muted_block = hl "MasonMutedBlock"
M.muted_block_bold = hl "MasonMutedBlockBold"
M.highlight = hl "MasonHighlight"
M.highlight_block = hl "MasonHighlightBlock"
M.highlight_block_bold = hl "MasonHighlightBlockBold"
M.highlight_block_secondary = hl "MasonHighlightBlockSecondary"
M.highlight_block_bold_secondary = hl "MasonHighlightBlockBoldSecondary"
M.highlight_secondary = hl "MasonHighlightSecondary"
M.error = hl "MasonError"
M.heading = hl "MasonHeading"

setmetatable(M, {
__index = function(self, key)
Expand Down

0 comments on commit 96294ce

Please sign in to comment.