Codesandbox-client: Tab width setting ignored when 'Use tabs' is active.

Created on 30 Nov 2017  ·  13Comments  ·  Source: codesandbox/codesandbox-client

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.

❕ Help Wanted 🐛 Bug 🔰 Beginner Friendly

Most helpful comment

Yep, I'll commit a fix now.

All 13 comments

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?

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Haroenv picture Haroenv  ·  3Comments

kentcdodds picture kentcdodds  ·  3Comments

oliversturm picture oliversturm  ·  3Comments

faceyspacey picture faceyspacey  ·  3Comments

miukimiu picture miukimiu  ·  3Comments