Skip to content

Commit

Permalink
Merge pull request #286 from projekt0n/feat/highlight-blend
Browse files Browse the repository at this point in the history
feat: Implement highlight-blend feature
  • Loading branch information
ful1e5 authored Jul 30, 2023
2 parents c2d20c2 + bf24744 commit 3c95ed3
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 13 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

### What's New?

- Implement [highlight-blend](https://neovim.io/doc/user/syntax.html#highlight-blend) feature #251

### Changes

-

### Issues Fix

-

## [v1.0.1] - 23 July 2023

### What's New?
Expand Down
15 changes: 8 additions & 7 deletions Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,14 @@ These values are: `add`, `removed`, `changed`, `conflict`, and `ignored`.
A `group` is the definition of a `highlight-group`. The key of the group table is the `highlight-group` that will be defined, and the table value is the
arguments to the |:highlight| command.

| Key | Help | Description |
| ----- | ------------------- | ---------------------------------------------------------- |
| fg | \|highlight-guifg\| | The color value of the foreground of the highlight group |
| bg | \|highlight-guibg\| | The color value of the background of the highlight group |
| sp | \|highlight-guisp\| | The color for underlines and undercurls |
| style | \|highlight-gui\| | The style of the highlight group. Ex `italic`, `bold`, etc |
| link | \|highlight-link\| | Link one `highlight-group` to another |
| Key | Help | Description |
| ----- | ------------------- | ---------------------------------------------------------------------------------------- |
| fg | \|highlight-guifg\| | The color value of the foreground of the highlight group |
| bg | \|highlight-guibg\| | The color value of the background of the highlight group |
| sp | \|highlight-guisp\| | The color for underlines and undercurls |
| blend | \|highlight-blend\| | Override the blend level for a highlight group within the popupmenu or floating windows. |
| style | \|highlight-gui\| | The style of the highlight group. Ex `italic`, `bold`, etc |
| link | \|highlight-link\| | Link one `highlight-group` to another |

If the value of `link` is present and is not empty, github theme will link the group to the corresponding value.

Expand Down
12 changes: 7 additions & 5 deletions doc/github-nvim-theme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,9 @@ A `group` is the definition of a `highlight-group`. The key of the group table
is the `highlight-group` that will be defined, and the table value is the
arguments to the |:highlight| command.

------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
Key Help Description
------- ------------------- --------------------------------------------------
------- ------------------- -------------------------------------------------------
fg |highlight-guifg| The color value of the foreground of the highlight
group

Expand All @@ -460,11 +460,13 @@ arguments to the |:highlight| command.

sp |highlight-guisp| The color for underlines and undercurls

style |highlight-gui| The style of the highlight group. Ex italic, bold,
etc
blend |highlight-blend| Override the blend level for a highlight group within
the popupmenu or floating windows.

style |highlight-gui| The style of the highlight group. Ex italic, bold, etc

link |highlight-link| Link one highlight-group to another
------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
If the value of `link` is present and is not empty, github theme will link the
group to the corresponding value.

Expand Down
1 change: 1 addition & 0 deletions lua/github-theme/lib/compiler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ vim.o.background = "%s"
op.bg = values.bg
op.fg = values.fg
op.sp = values.sp
op.blend = values.blend
table.insert(lines, fmt([[h(0, "%s", %s)]], name, inspect(op)))
end
end
Expand Down
6 changes: 5 additions & 1 deletion lua/github-theme/util/template.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ function M.parse(template, spec)
if type(opts) == 'table' then
local new = {}
for key, value in pairs(opts) do
new[key] = parse_string(value, spec)
if type(value) == 'string' then
new[key] = parse_string(value, spec)
elseif type(value) == 'number' then
new[key] = value
end
end
result[group] = new
else
Expand Down

0 comments on commit 3c95ed3

Please sign in to comment.