Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement highlight-blend feature #286

Merged
merged 2 commits into from
Jul 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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