Skip to content

Commit

Permalink
monaco: fix gutter size due to lineNumbers
Browse files Browse the repository at this point in the history
The following commit updates the default `lineNumbersMinChars` similarly to vscode in order
to produce a more appropriate gutter size (lineNumber size) in the editor. Reducing the size
means that we can improve the readability of the code rather than have excessive gutters.

Signed-off-by: vince-fugnitto <[email protected]>
  • Loading branch information
vince-fugnitto committed Mar 11, 2021
1 parent 3426e8d commit 3bef155
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/monaco/src/browser/monaco-editor-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export class MonacoEditorModel implements ITextEditorModel, TextEditorDocument {
autoSave: 'on' | 'off' = 'on';
autoSaveDelay: number = 500;
suppressOpenEditorWhenDirty = false;
lineNumbersMinChars = 3;

/* @deprecated there is no general save timeout, each participant should introduce a sensible timeout */
readonly onWillSaveLoopTimeOut = 1500;
protected bufferSavedVersionId: number;
Expand Down
1 change: 1 addition & 0 deletions packages/monaco/src/browser/monaco-editor-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ export class MonacoEditorProvider {
const options = this.createOptions(this.preferencePrefixes, model.uri, model.languageId);
options.model = model.textEditorModel;
options.readOnly = model.readOnly;
options.lineNumbersMinChars = model.lineNumbersMinChars;
return options;
}
protected updateMonacoEditorOptions(editor: MonacoEditor, event?: EditorPreferenceChange): void {
Expand Down

0 comments on commit 3bef155

Please sign in to comment.