Skip to content

Commit

Permalink
fix(highlight): make borderColor work (#1557)
Browse files Browse the repository at this point in the history
* chore(schema): predefine highlight `CurSearch`

* fix(highlight): make `borderColor` work
  • Loading branch information
xiyaowong committed Oct 22, 2023
1 parent 5260b66 commit 398d0fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
"vscode-neovim.highlightGroups.highlights": {
"type": "object",
"title": "Highlight Groups Configuration",
"description": "Define colors for various VIM highlight groups. Values may be 'vim' to use colors from vim or text decoration properties object",
"description": "Define colors for various VIM highlight groups. Values are text decoration properties object",
"additionalProperties": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -191,6 +191,10 @@
"backgroundColor": "theme.editor.findMatchBackground",
"borderColor": "theme.editor.findMatchBorder"
},
"CurSearch": {
"backgroundColor": "theme.editor.findMatchBackground",
"borderColor": "theme.editor.findMatchBorder"
},
"Search": {
"backgroundColor": "theme.editor.findMatchHighlightBackground",
"borderColor": "theme.editor.findMatchHighlightBorder"
Expand Down
3 changes: 3 additions & 0 deletions src/highlight_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ export class HighlightProvider {
}

private createDecoratorForHighlightId(id: number, options: ThemableDecorationRenderOptions): void {
if (options.borderColor != null && options.border == null) {
options.border = "1px solid";
}
const decorator = window.createTextEditorDecorationType({
...options,
rangeBehavior: DecorationRangeBehavior.ClosedClosed,
Expand Down

0 comments on commit 398d0fe

Please sign in to comment.