Skip to content

Commit

Permalink
filter decorations
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSiefke committed Jul 22, 2024
1 parent cfafb19 commit a8e7495
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ class Settings {

this.themeType = theme.type;

const overviewRulerEnabled = options.get(EditorOption.overviewRulerEnabled);
if (!overviewRulerEnabled) {
this.renderBorder = false;
this.borderColor = null;
this.hideCursor = true;

}

const minimapOpts = options.get(EditorOption.minimap);
const minimapEnabled = minimapOpts.enabled;
const minimapSide = minimapOpts.side;
Expand Down Expand Up @@ -416,6 +424,7 @@ export class DecorationsOverviewRuler extends ViewPart {
for (const decorationGroup of decorations) {
const color = decorationGroup.color;
const decorationGroupData = decorationGroup.data;
decorationGroup.data

canvasCtx.fillStyle = color;

Expand Down
11 changes: 10 additions & 1 deletion src/vs/editor/common/viewModel/viewModelImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,16 @@ export class ViewModel extends Disposable implements IViewModel {
public getAllOverviewRulerDecorations(theme: EditorTheme): OverviewRulerDecorationsGroup[] {
const decorations = this.model.getOverviewRulerDecorations(this._editorId, filterValidationDecorations(this._configuration.options));
const result = new OverviewRulerDecorations();
for (const decoration of decorations) {
const overviewRulerDecorationsEnabled = this._configuration.options.get(EditorOption.fontInfo);
const minimalAllowed: string[] = [];
const filteredDecorations = decorations.filter(d => {
if (overviewRulerDecorationsEnabled) {
return true;
}
return minimalAllowed.includes(d.id);
});

for (const decoration of filteredDecorations) {
const decorationOptions = <ModelDecorationOptions>decoration.options;
const opts = decorationOptions.overviewRuler;
if (!opts) {
Expand Down

0 comments on commit a8e7495

Please sign in to comment.