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

Fix: Add border to search decorations #8722

Merged
merged 5 commits into from
Nov 17, 2023
Merged
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
10 changes: 10 additions & 0 deletions src/configuration/decoration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ class DecorationImpl {
color: 'transparent',
backgroundColor: searchHighlightBackgroundColor,
},
border: '1px solid',
borderColor: new vscode.ThemeColor('editor.findMatchHighlightBorder'),
});

const searchMatchBackgroundColor = configuration.searchMatchColor
Expand All @@ -209,6 +211,8 @@ class DecorationImpl {
color: 'transparent',
backgroundColor: searchMatchBackgroundColor,
},
border: '2px solid',
borderColor: new vscode.ThemeColor('editor.findMatchBorder'),
});

const substitutionBackgroundColor = configuration.substitutionColor
Expand All @@ -222,7 +226,11 @@ class DecorationImpl {
after: {
color: configuration.substitutionTextColor,
backgroundColor: substitutionBackgroundColor,
border: '1px solid',
borderColor: new vscode.ThemeColor('editor.findMatchBorder'),
},
border: '1px dashed',
borderColor: new vscode.ThemeColor('editor.findMatchBorder'),
});

// Use letterSpacing and opacity to hide the decorated range, so that before text gets rendered over it
Expand All @@ -233,6 +241,8 @@ class DecorationImpl {
before: {
color: configuration.substitutionTextColor,
backgroundColor: substitutionBackgroundColor,
border: '1px solid',
borderColor: new vscode.ThemeColor('editor.findMatchBorder'),
},
});

Expand Down