提交 f61fb802 编写于 作者: I isidor

editor: setIndentationOptions

上级 44c0b170
......@@ -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);
}
......
......@@ -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,
......
......@@ -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
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册