An easy way to reproduce this is to set Tab width settings to 4 and set Use tabs to true. The width stays at 2 spaces.
Also, hitting Tab when set to _4 spaces_ indents only _2 spaces_.
Oh, I missed this in my notifications, sorry!
I think this is a problem in Monaco.js. We need to get this from preferences: https://github.com/CompuIves/codesandbox-client/blob/master/packages/app/src/app/components/sandbox/CodeEditor/Monaco.js#L795-L796.
@CompuIves, would that look something like this?
model.updateOptions({ tabSize: this.props.preferences.tabSize });
Exactly @ryanpcmcquen! Thank you very much, could you open a PR for it?
@CompuIves, tests are running now!
https://github.com/CompuIves/codesandbox-client/pull/397
This bug is back @CompuIves, regression?
Yep, I'll commit a fix now.
@CompuIves, is this fix live? Because I am still seeing the issue. It also seems that the tab width setting disappeared from preferences.
Yep it's live! We infer it from Prettier settings though, that's why it's not in Code Editor preferencecs anymore. Do you think it'd be better if it was in Code Editor?
@CompuIves, I have it set to 4 in Prettier settings and am still getting an indent of 2.
Ah I'm so sorry for that! Just committed a fix and will go live today.
Thanks @CompuIves!
This problem seems to be fixed only when monaco editor is selected. With CodeMirror it still remains unfixed.
Most helpful comment
Yep, I'll commit a fix now.