Skip to content

Commit

Permalink
fix(hl): use default hl groups (#28)
Browse files Browse the repository at this point in the history
* fix(hl): use default hl groups

* refactor: try to improve EmmyLua type annotation

* docs: update readme
  • Loading branch information
disrupted authored Feb 22, 2025
1 parent 805d918 commit 82f382c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 35 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,14 @@ The default options (as defined in [lua/config.lua](./blob/main/lua/pipeline/con
},
},
highlights = {
PipelineRunIconSuccess = { link = 'LspDiagnosticsVirtualTextHint' },
PipelineRunIconFailure = { link = 'LspDiagnosticsVirtualTextError' },
PipelineRunIconStartup_failure = { link = 'LspDiagnosticsVirtualTextError' },
PipelineRunIconPending = { link = 'LspDiagnosticsVirtualTextWarning' },
PipelineRunIconRequested = { link = 'LspDiagnosticsVirtualTextWarning' },
PipelineRunIconWaiting = { link = 'LspDiagnosticsVirtualTextWarning' },
PipelineRunIconIn_progress = { link = 'LspDiagnosticsVirtualTextWarning' },
PipelineError = { link = 'DiagnosticError' },
PipelineRunIconSuccess = { link = 'DiagnosticOk' },
PipelineRunIconFailure = { link = 'DiagnosticError' },
PipelineRunIconStartup_failure = { link = 'DiagnosticError' },
PipelineRunIconPending = { link = 'DiagnosticWarn' },
PipelineRunIconRequested = { link = 'DiagnosticWarn' },
PipelineRunIconWaiting = { link = 'DiagnosticWarn' },
PipelineRunIconIn_progress = { link = 'DiagnosticWarn' },
PipelineRunIconCancelled = { link = 'Comment' },
PipelineRunIconSkipped = { link = 'Comment' },
PipelineRunCancelled = { link = 'Comment' },
Expand All @@ -148,7 +149,6 @@ The default options (as defined in [lua/config.lua](./blob/main/lua/pipeline/con
},
},
}

```

## lualine integration
Expand Down
37 changes: 10 additions & 27 deletions lua/pipeline/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,41 +38,24 @@ local defaultConfig = {
in_progress = '',
},
},
---@class pipeline.config.Highlights
---@alias hl_group 'PipelineError' | 'PipelineRunIconSuccess' | 'PipelineRunIconFailure' | 'PipelineRunIconStartup_failure' | 'PipelineRunIconPending' | 'PipelineRunIconRequested' | 'PipelineRunIconWaiting' | 'PipelineRunIconIn_progress' | 'PipelineRunIconCancelled' | 'PipelineRunIconSkipped' | 'PipelineRunCancelled' | 'PipelineRunSkipped' | 'PipelineJobCancelled' | 'PipelineJobSkipped' | 'PipelineStepCancelled' | 'PipelineStepSkipped'
---@type table<hl_group, vim.api.keyset.highlight>
highlights = {
---@type vim.api.keyset.highlight
PipelineError = { link = 'LspDiagnosticsVirtualTextError' },
---@type vim.api.keyset.highlight
PipelineRunIconSuccess = { link = 'LspDiagnosticsVirtualTextHint' },
---@type vim.api.keyset.highlight
PipelineRunIconFailure = { link = 'LspDiagnosticsVirtualTextError' },
---@type vim.api.keyset.highlight
PipelineRunIconStartup_failure = {
link = 'LspDiagnosticsVirtualTextError',
},
---@type vim.api.keyset.highlight
PipelineRunIconPending = { link = 'LspDiagnosticsVirtualTextWarning' },
---@type vim.api.keyset.highlight
PipelineRunIconRequested = { link = 'LspDiagnosticsVirtualTextWarning' },
---@type vim.api.keyset.highlight
PipelineRunIconWaiting = { link = 'LspDiagnosticsVirtualTextWarning' },
---@type vim.api.keyset.highlight
PipelineRunIconIn_progress = { link = 'LspDiagnosticsVirtualTextWarning' },
---@type vim.api.keyset.highlight
PipelineError = { link = 'DiagnosticError' },
PipelineRunIconSuccess = { link = 'DiagnosticOk' },
PipelineRunIconFailure = { link = 'DiagnosticError' },
PipelineRunIconStartup_failure = { link = 'DiagnosticError' },
PipelineRunIconPending = { link = 'DiagnosticWarn' },
PipelineRunIconRequested = { link = 'DiagnosticWarn' },
PipelineRunIconWaiting = { link = 'DiagnosticWarn' },
PipelineRunIconIn_progress = { link = 'DiagnosticWarn' },
PipelineRunIconCancelled = { link = 'Comment' },
---@type vim.api.keyset.highlight
PipelineRunIconSkipped = { link = 'Comment' },
---@type vim.api.keyset.highlight
PipelineRunCancelled = { link = 'Comment' },
---@type vim.api.keyset.highlight
PipelineRunSkipped = { link = 'Comment' },
---@type vim.api.keyset.highlight
PipelineJobCancelled = { link = 'Comment' },
---@type vim.api.keyset.highlight
PipelineJobSkipped = { link = 'Comment' },
---@type vim.api.keyset.highlight
PipelineStepCancelled = { link = 'Comment' },
---@type vim.api.keyset.highlight
PipelineStepSkipped = { link = 'Comment' },
},
---@type nui_split_options
Expand Down

0 comments on commit 82f382c

Please sign in to comment.