From 35bd4866a32a5c1591d17fb8903a211daa7dbad2 Mon Sep 17 00:00:00 2001 From: Daniel Hill <9439488+blazkowolf@users.noreply.github.com> Date: Mon, 3 Apr 2023 23:33:53 -0400 Subject: [PATCH] fix: remove `default` field from palette --- lua/gruber-darker/highlights/colorscheme.lua | 2 +- lua/gruber-darker/highlights/lsp.lua | 15 +++++++- lua/gruber-darker/highlights/terminal.lua | 36 ++++++++++---------- lua/gruber-darker/highlights/treesitter.lua | 4 +-- lua/gruber-darker/highlights/vim.lua | 7 ++-- lua/gruber-darker/palette.lua | 2 +- 6 files changed, 40 insertions(+), 26 deletions(-) diff --git a/lua/gruber-darker/highlights/colorscheme.lua b/lua/gruber-darker/highlights/colorscheme.lua index 7777220..bb394c3 100644 --- a/lua/gruber-darker/highlights/colorscheme.lua +++ b/lua/gruber-darker/highlights/colorscheme.lua @@ -1,5 +1,5 @@ local Highlight = require("gruber-darker.highlight") -local c = require("gruber-darker.palette").default +local c = require("gruber-darker.palette") local opts = require("gruber-darker.config").get_opts() ---@type HighlightsProvider diff --git a/lua/gruber-darker/highlights/lsp.lua b/lua/gruber-darker/highlights/lsp.lua index 3db0aa0..45dc29f 100644 --- a/lua/gruber-darker/highlights/lsp.lua +++ b/lua/gruber-darker/highlights/lsp.lua @@ -1,5 +1,5 @@ local Highlight = require("gruber-darker.highlight") -local c = require("gruber-darker.palette").default +local c = require("gruber-darker.palette") local opts = require("gruber-darker.config").get_opts() local gruber_hl = require("gruber-darker.highlights.colorscheme").highlights @@ -30,4 +30,17 @@ M.highlights.diagnostic_hint = Highlight.new("DiagnosticHint", { link = gruber_h M.highlights.diagnostic_sign_hint = Highlight.new("DiagnosticSignHint", { link = gruber_hl.wisteria_sign }) M.highlights.diagnostic_underline_hint = Highlight.new("DiagnosticUnderlineHint", { link = gruber_hl.wisteria_underline }) +---Used for highlighting "text" references +-- M.highlights.lsp_reference_text = Highlight.new("LspReferenceText", {}) +---Used for highlighting "read" references +-- M.highlights.lsp_reference_read = Highlight.new("LspReferenceRead", {}) +---Used for highlighting "write" references +-- M.highlights.lsp_reference_write = Highlight.new("LspReferenceWrite", {}) +---Used to color the virtual text of the codelens. +-- M.highlights.lsp_code_lens = Highlight.new("LspCodeLens", {}) +---Used to color the separator between two or more code lenses. +-- M.highlights.lsp_code_lens_separator = Highlight.new("LspCodeLensSeparator", {}) +---Used to highlight the active parameter in the signature help. +-- M.highlights.lsp_signature_active_parameter = Highlight.new("LspSignatureActiveParameter", {}) + return M diff --git a/lua/gruber-darker/highlights/terminal.lua b/lua/gruber-darker/highlights/terminal.lua index 17e6af6..ea04bc0 100644 --- a/lua/gruber-darker/highlights/terminal.lua +++ b/lua/gruber-darker/highlights/terminal.lua @@ -7,32 +7,32 @@ local M = {} function M.setup() -- terminal colors adapted from -- https://github.com/drsooch/gruber-darker-vim/blob/master/colors/GruberDarker.vim#L202 - vim.g.terminal_color_0 = c.default["bg+1"]:to_string() - vim.g.terminal_color_8 = c.default["bg+1"]:to_string() + vim.g.terminal_color_0 = c["bg+1"]:to_string() + vim.g.terminal_color_8 = c["bg+1"]:to_string() - vim.g.terminal_color_1 = c.default["red+1"]:to_string() - vim.g.terminal_color_9 = c.default["red+1"]:to_string() + vim.g.terminal_color_1 = c["red+1"]:to_string() + vim.g.terminal_color_9 = c["red+1"]:to_string() - vim.g.terminal_color_2 = c.default.green:to_string() - vim.g.terminal_color_10 = c.default.green:to_string() + vim.g.terminal_color_2 = c.green:to_string() + vim.g.terminal_color_10 = c.green:to_string() - vim.g.terminal_color_3 = c.default.yellow:to_string() - vim.g.terminal_color_11 = c.default.yellow:to_string() + vim.g.terminal_color_3 = c.yellow:to_string() + vim.g.terminal_color_11 = c.yellow:to_string() - vim.g.terminal_color_4 = c.default.niagara:to_string() - vim.g.terminal_color_12 = c.default.niagara:to_string() + vim.g.terminal_color_4 = c.niagara:to_string() + vim.g.terminal_color_12 = c.niagara:to_string() - vim.g.terminal_color_5 = c.default.wisteria:to_string() - vim.g.terminal_color_13 = c.default.wisteria:to_string() + vim.g.terminal_color_5 = c.wisteria:to_string() + vim.g.terminal_color_13 = c.wisteria:to_string() - vim.g.terminal_color_6 = c.default.niagara:to_string() - vim.g.terminal_color_14 = c.default.niagara:to_string() + vim.g.terminal_color_6 = c.niagara:to_string() + vim.g.terminal_color_14 = c.niagara:to_string() - vim.g.terminal_color_7 = c.default.fg:to_string() - vim.g.terminal_color_15 = c.default.fg:to_string() + vim.g.terminal_color_7 = c.fg:to_string() + vim.g.terminal_color_15 = c.fg:to_string() - vim.g.terminal_color_background = c.default["bg+1"]:to_string() - vim.g.terminal_color_foreground = c.default.white:to_string() + vim.g.terminal_color_background = c["bg+1"]:to_string() + vim.g.terminal_color_foreground = c.white:to_string() end return M diff --git a/lua/gruber-darker/highlights/treesitter.lua b/lua/gruber-darker/highlights/treesitter.lua index 88cb7f7..4c82de6 100644 --- a/lua/gruber-darker/highlights/treesitter.lua +++ b/lua/gruber-darker/highlights/treesitter.lua @@ -1,4 +1,4 @@ -local c = require("gruber-darker.palette").default +local c = require("gruber-darker.palette") local opts = require("gruber-darker.config").get_opts() local vim_hl = require("gruber-darker.highlights.vim").highlights local gruber_hl = require("gruber-darker.highlights.colorscheme").highlights @@ -209,7 +209,7 @@ M.highlights.text_diff_change = Highlight.new("@text.diff.change", { link = vim_ ---XML tag names M.highlights.tag = Highlight.new("@tag", { link = vim_hl.tag }) ---XML tag attributes -M.highlights.tag_attribute = Highlight.new("@tag.attribute", { link = vim_hl.identifier }) +M.highlights.tag_attribute = Highlight.new("@tag.attribute", { link = M.highlights.field }) ---XML tag delimiters M.highlights.tag_delimiter = Highlight.new("@tag.delimiter", { link = vim_hl.delimiter }) diff --git a/lua/gruber-darker/highlights/vim.lua b/lua/gruber-darker/highlights/vim.lua index 12e2d30..8a59685 100644 --- a/lua/gruber-darker/highlights/vim.lua +++ b/lua/gruber-darker/highlights/vim.lua @@ -1,8 +1,9 @@ local Highlight = require("gruber-darker.highlight") -local c = require("gruber-darker.palette").default +local c = require("gruber-darker.palette") local opts = require("gruber-darker.config").get_opts() local gruber_hl = require("gruber-darker.highlights.colorscheme").highlights +---@type HighlightsProvider local M = { highlights = {}, } @@ -76,7 +77,7 @@ M.highlights.mode_msg = Highlight.new("ModeMsg", { link = gruber_hl.fg2 }) ---|more-prompt| M.highlights.more_msg = Highlight.new("MoreMsg", { fg = c["fg+2"] }) ---'@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|. -M.highlights.non_text = Highlight.new("NonText", { fg = c["fg+2"] }) +M.highlights.non_text = Highlight.new("NonText", { link = M.highlights.end_of_buffer }) ---Normal text M.highlights.normal = Highlight.new("Normal", { fg = c.fg, bg = c.bg }) ---Normal text in non-current windows @@ -85,7 +86,7 @@ M.highlights.normal_non_current = Highlight.new("NormalNC", { fg = c.fg, bg = c[ M.highlights.normal_sidebar = Highlight.new("NormalSB", { fg = c.fg, bg = c["bg-1"] }) ---Normal text in floating windows. M.highlights.normal_float = Highlight.new("NormalFloat", { fg = c.fg, bg = c.bg }) -M.highlights.float_border = Highlight.new("FloatBorder", { fg = c["bg+2"], bg = c["bg-1"] }) +M.highlights.float_border = Highlight.new("FloatBorder", { fg = c["bg+4"], bg = c.none }) -- Popup diff --git a/lua/gruber-darker/palette.lua b/lua/gruber-darker/palette.lua index 9b33ff4..8f780a6 100644 --- a/lua/gruber-darker/palette.lua +++ b/lua/gruber-darker/palette.lua @@ -2,7 +2,7 @@ local Color = require("gruber-darker.color") local M = {} ---@type table -M.default = { +M = { none = Color.none(), fg = Color.new(0xe4e4e4), ["fg+1"] = Color.new(0xf4f4ff),