Skip to content

Commit 5c375ef

Browse files
committed
Use array of class names instead of string
1 parent adb27e5 commit 5c375ef

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

src/vs/editor/common/config/editorOptions.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,26 +1217,28 @@ class EditorClassName extends ComputedEditorOption<EditorOption.editorClassName,
12171217
}
12181218

12191219
public compute(env: IEnvironmentalOptions, options: IComputedEditorOptions, _: string): string {
1220-
let className = 'monaco-editor';
1220+
const classNames = ['monaco-editor'];
12211221
if (options.get(EditorOption.extraEditorClassName)) {
1222-
className += ' ' + options.get(EditorOption.extraEditorClassName);
1222+
classNames.push(options.get(EditorOption.extraEditorClassName));
12231223
}
12241224
if (env.extraEditorClassName) {
1225-
className += ' ' + env.extraEditorClassName;
1225+
classNames.push(env.extraEditorClassName);
12261226
}
12271227
if (options.get(EditorOption.mouseStyle) === 'default') {
1228-
className += ' mouse-default';
1228+
classNames.push('mouse-default');
12291229
} else if (options.get(EditorOption.mouseStyle) === 'copy') {
1230-
className += ' mouse-copy';
1230+
classNames.push('mouse-copy');
12311231
}
1232+
12321233
if (options.get(EditorOption.showUnused)) {
1233-
className += ' showUnused';
1234+
classNames.push('showUnused');
12341235
}
12351236

12361237
if (options.get(EditorOption.showDeprecated)) {
1237-
className += ' showDeprecated';
1238+
classNames.push('showDeprecated');
12381239
}
1239-
return className;
1240+
1241+
return classNames.join(' ');
12401242
}
12411243
}
12421244

0 commit comments

Comments
 (0)