Skip to content

Commit

Permalink
feat: add new DiagnosticOk highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Sep 26, 2023
1 parent ee3525f commit badc2b7
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 5 deletions.
6 changes: 3 additions & 3 deletions doc/nightfox.txt
Original file line number Diff line number Diff line change
Expand Up @@ -439,16 +439,16 @@ spec.syntax The `syntax` table maps
spec.diag The `diag` table maps |nightfox-palette|
colors to vim diagnostic colors values.
These values are: `error`, `warn`,
`info` and `hint`.
`info`, `hint`, and `ok`.


*nightfox-spec.diag_bg*

spec.diag_bg The `diag_bg` table maps
|nightfox-palette| colors to vim
diagnostic background colors. These
values are: `error`, `warn`, `info` and
`hint`.
values are: `error`, `warn`, `info`,
`hint`, and `ok`.


*nightfox-spec.diff*
Expand Down
4 changes: 4 additions & 0 deletions lua/nightfox/group/modules/diagnostic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,25 @@ function M.get(spec, config, opts)
DiagnosticWarn = { fg = d.warn },
DiagnosticInfo = { fg = d.info },
DiagnosticHint = { fg = d.hint },
DiagnosticOk = { fg = d.ok },

DiagnosticSignError = { link = "DiagnosticError" },
DiagnosticSignWarn = { link = "DiagnosticWarn" },
DiagnosticSignInfo = { link = "DiagnosticInfo" },
DiagnosticSignHint = { link = "DiagnosticHint" },
DiagnosticSignOk = { link = "DiagnosticOk" },

DiagnosticVirtualTextError = { fg = d.error, bg = opts.background and dbg.error or "NONE" },
DiagnosticVirtualTextWarn = { fg = d.warn, bg = opts.background and dbg.warn or "NONE" },
DiagnosticVirtualTextInfo = { fg = d.info, bg = opts.background and dbg.info or "NONE" },
DiagnosticVirtualTextHint = { fg = d.hint, bg = opts.background and dbg.hint or "NONE" },
DiagnosticVirtualTextOk = { fg = d.ok, bg = opts.background and dbg.ok or "NONE" },

DiagnosticUnderlineError = { style = "undercurl", sp = d.error },
DiagnosticUnderlineWarn = { style = "undercurl", sp = d.warn },
DiagnosticUnderlineInfo = { style = "undercurl", sp = d.info },
DiagnosticUnderlineHint = { style = "undercurl", sp = d.hint },
DiagnosticUnderlineOk = { style = "undercurl", sp = d.ok },
}
end

Expand Down
2 changes: 2 additions & 0 deletions lua/nightfox/palette/carbonfox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,15 @@ local function generate_spec(pal)
warn = pal.magenta.base,
info = pal.blue.base,
hint = pal.orange.base,
ok = pal.green.base,
}

spec.diag_bg = {
error = C(spec.bg1):blend(C(spec.diag.error), 0.15):to_css(),
warn = C(spec.bg1):blend(C(spec.diag.warn), 0.15):to_css(),
info = C(spec.bg1):blend(C(spec.diag.info), 0.15):to_css(),
hint = C(spec.bg1):blend(C(spec.diag.hint), 0.15):to_css(),
ok = C(spec.bg1):blend(C(spec.diag.ok), 0.15):to_css(),
}

spec.diff = {
Expand Down
2 changes: 2 additions & 0 deletions lua/nightfox/palette/dawnfox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ local function generate_spec(pal)
warn = pal.yellow.base,
info = pal.blue.base,
hint = pal.green.base,
ok = pal.green.base,
}

spec.diag_bg = {
error = C(spec.bg1):blend(C(spec.diag.error), 0.3):to_css(),
warn = C(spec.bg1):blend(C(spec.diag.warn), 0.3):to_css(),
info = C(spec.bg1):blend(C(spec.diag.info), 0.3):to_css(),
hint = C(spec.bg1):blend(C(spec.diag.hint), 0.3):to_css(),
ok = C(spec.bg1):blend(C(spec.diag.ok), 0.3):to_css(),
}

spec.diff = {
Expand Down
2 changes: 2 additions & 0 deletions lua/nightfox/palette/dayfox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ local function generate_spec(pal)
warn = pal.yellow.base,
info = pal.blue.base,
hint = pal.green.base,
ok = pal.green.base,
}

spec.diag_bg = {
error = C(spec.bg1):blend(C(spec.diag.error), 0.3):to_css(),
warn = C(spec.bg1):blend(C(spec.diag.warn), 0.3):to_css(),
info = C(spec.bg1):blend(C(spec.diag.info), 0.3):to_css(),
hint = C(spec.bg1):blend(C(spec.diag.hint), 0.3):to_css(),
ok = C(spec.bg1):blend(C(spec.diag.ok), 0.3):to_css(),
}

spec.diff = {
Expand Down
2 changes: 2 additions & 0 deletions lua/nightfox/palette/duskfox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ local function generate_spec(pal)
warn = pal.yellow.base,
info = pal.blue.base,
hint = pal.green.base,
ok = pal.green.base,
}

spec.diag_bg = {
error = C(spec.bg1):blend(C(spec.diag.error), 0.15):to_css(),
warn = C(spec.bg1):blend(C(spec.diag.warn), 0.15):to_css(),
info = C(spec.bg1):blend(C(spec.diag.info), 0.15):to_css(),
hint = C(spec.bg1):blend(C(spec.diag.hint), 0.15):to_css(),
ok = C(spec.bg1):blend(C(spec.diag.ok), 0.15):to_css(),
}

spec.diff = {
Expand Down
2 changes: 2 additions & 0 deletions lua/nightfox/palette/nightfox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ local function generate_spec(pal)
warn = pal.yellow.base,
info = pal.blue.base,
hint = pal.green.base,
ok = pal.green.base,
}

spec.diag_bg = {
error = C(spec.bg1):blend(C(spec.diag.error), 0.2):to_css(),
warn = C(spec.bg1):blend(C(spec.diag.warn), 0.2):to_css(),
info = C(spec.bg1):blend(C(spec.diag.info), 0.2):to_css(),
hint = C(spec.bg1):blend(C(spec.diag.hint), 0.2):to_css(),
ok = C(spec.bg1):blend(C(spec.diag.ok), 0.2):to_css(),
}

spec.diff = {
Expand Down
2 changes: 2 additions & 0 deletions lua/nightfox/palette/nordfox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ local function generate_spec(pal)
warn = pal.yellow.base,
info = pal.blue.base,
hint = pal.green.base,
ok = pal.green.base,
}

spec.diag_bg = {
error = C(spec.bg1):blend(C(spec.diag.error), 0.2):to_css(),
warn = C(spec.bg1):blend(C(spec.diag.warn), 0.2):to_css(),
info = C(spec.bg1):blend(C(spec.diag.info), 0.2):to_css(),
hint = C(spec.bg1):blend(C(spec.diag.hint), 0.2):to_css(),
ok = C(spec.bg1):blend(C(spec.diag.ok), 0.2):to_css(),
}

spec.diff = {
Expand Down
2 changes: 2 additions & 0 deletions lua/nightfox/palette/terafox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,15 @@ local function generate_spec(pal)
warn = pal.yellow.base,
info = pal.blue.base,
hint = pal.green.base,
ok = pal.green.base,
}

spec.diag_bg = {
error = C(spec.bg1):blend(C(spec.diag.error), 0.15):to_css(),
warn = C(spec.bg1):blend(C(spec.diag.warn), 0.15):to_css(),
info = C(spec.bg1):blend(C(spec.diag.info), 0.15):to_css(),
hint = C(spec.bg1):blend(C(spec.diag.hint), 0.15):to_css(),
ok = C(spec.bg1):blend(C(spec.diag.ok), 0.15):to_css(),
}

spec.diff = {
Expand Down
2 changes: 2 additions & 0 deletions lua/nightfox/spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ local template = require("nightfox.util.template")
---@field warn string
---@field info string
---@field hint string
---@field ok string

---@class SpecDiagnosticBg
---@field error string
---@field warn string
---@field info string
---@field hint string
---@field ok string

---@class SpecDiff
---@field add string
Expand Down
1 change: 1 addition & 0 deletions misc/feline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ local function generate_pallet_from_colorscheme()
info = { hl = "DiagnosticInfo", default = color_map.blue.default },
warn = { hl = "DiagnosticWarn", default = color_map.yellow.default },
error = { hl = "DiagnosticError", default = color_map.red.default },
ok = { hl = "DiagnosticOk", default = color_map.green.default },
}

local pallet = {}
Expand Down
4 changes: 2 additions & 2 deletions usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,12 @@ The `syntax` table maps [palette] color values to syntax values to be used by th
#### spec.diag

The `diag` table maps [palette] colors to vim diagnostic colors values.
These values are: `error`, `warn`, `info` and `hint`.
These values are: `error`, `warn`, `info`, `hint`, and `ok`.

#### spec.diag_bg

The `diag_bg` table maps [palette] colors to vim diagnostic background colors.
These values are: `error`, `warn`, `info` and `hint`.
These values are: `error`, `warn`, `info`, `hint`, and `ok`.

#### spec.diff

Expand Down

0 comments on commit badc2b7

Please sign in to comment.