monaco-editor npm version: 0.7.0
Browser: Chrome 54.0.2840.99
OS: Windows 10
I want custom code tab width, use 2 spaces or 8 spaces.
Paging @alexandrudima. monaco.d.ts has no reference to any code tab width setting.
model.updateOptions({ tabSize: 8 }). You can create a model yourself via monaco.editor.createModel(...) or use the one created by the editor on your behalf editor.getModel()
Thanks a lot!
@alexandrudima Is your solution deprecated now? Because for me it works when I call updateOptions on the editor itself, not on the model.
@chinchang tabSize is a model property, so one must call updateOptions on the model instance in order to change tabSize.
Most helpful comment
model.updateOptions({ tabSize: 8 }). You can create a model yourself viamonaco.editor.createModel(...)or use the one created by the editor on your behalfeditor.getModel()