diff --git a/src/vs/editor/common/commonCodeEditor.ts b/src/vs/editor/common/commonCodeEditor.ts index f16c2ec47a8d2527dbe7be73f2572d7429853eee..a6fb1e06c96f45274f9255b32784e0e58a6390e0 100644 --- a/src/vs/editor/common/commonCodeEditor.ts +++ b/src/vs/editor/common/commonCodeEditor.ts @@ -213,6 +213,10 @@ export abstract class CommonCodeEditor extends EventEmitter implements IActionPr }; } + public setIndentationOptions(indentationOptions: editorCommon.IInternalIndentationOptions): void { + this._configuration.setIndentationOptions(indentationOptions); + } + public normalizeIndentation(str:string): string { return this._configuration.normalizeIndentation(str); } diff --git a/src/vs/editor/common/config/commonEditorConfig.ts b/src/vs/editor/common/config/commonEditorConfig.ts index 9a483998f7240b3d88a840cea8bb674398e7dd05..add14f8dda2bd82f329a8caf697d58c5a1eee866 100644 --- a/src/vs/editor/common/config/commonEditorConfig.ts +++ b/src/vs/editor/common/config/commonEditorConfig.ts @@ -727,6 +727,10 @@ export abstract class CommonEditorConfiguration extends Disposable implements ed return this.editor.indentInfo; } + public setIndentationOptions(indentationOptions: editorCommon.IInternalIndentationOptions): void { + this.editor.indentInfo = indentationOptions; + } + private _normalizeIndentationFromWhitespace(str:string): string { let indentation = this.getIndentationOptions(), spacesCnt = 0, diff --git a/src/vs/editor/common/editorCommon.ts b/src/vs/editor/common/editorCommon.ts index 63a0c58d5dbb7caf04a23a982c9dadda36e453af..e08c7afa54269fe5a68789a6b0aeb5c2a85df88b 100644 --- a/src/vs/editor/common/editorCommon.ts +++ b/src/vs/editor/common/editorCommon.ts @@ -3078,6 +3078,11 @@ export interface ICommonCodeEditor extends IEditor { */ getIndentationOptions(): IInternalIndentationOptions; + /** + * Sets the indentation options of the editor. + */ + setIndentationOptions(IInternalIndentationOptions): void; + /** * Normalize whitespace using the editor's whitespace specific settings */