Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set tab width ? #270

Closed
lc-soft opened this issue Nov 21, 2016 · 5 comments
Closed

How to set tab width ? #270

lc-soft opened this issue Nov 21, 2016 · 5 comments
Assignees
Milestone

Comments

@lc-soft
Copy link

lc-soft commented Nov 21, 2016

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.

@alex-kinokon
Copy link

alex-kinokon commented Dec 2, 2016

Paging @alexandrudima. monaco.d.ts has no reference to any code tab width setting.

@alexdima
Copy link
Member

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()

@alexdima alexdima self-assigned this Jan 17, 2017
@alexdima alexdima added this to the Backlog milestone Jan 17, 2017
@alex-kinokon
Copy link

Thanks a lot!

@chinchang
Copy link

@alexandrudima Is your solution deprecated now? Because for me it works when I call updateOptions on the editor itself, not on the model.

@alexdima
Copy link
Member

@chinchang tabSize is a model property, so one must call updateOptions on the model instance in order to change tabSize.

@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants