Don't interfere with file indent configuration

pull/206/head
Liam 2023-03-24 01:28:03 -04:00
parent 30cd758e39
commit 6987e4265d
2 changed files with 4 additions and 2 deletions

View File

@ -508,12 +508,14 @@ export function useExtensions({
}, [fileIndentUnit, editorRef.current, justCreated])
useEffect(() => {
if (settings.tabSize != undefined) {
editorRef.current.view?.dispatch({
effects: indentCompartment.reconfigure([
indentUnit.of(" ".repeat(Number(settings.tabSize))),
EditorState.tabSize.of(Number(settings.tabSize))
]),
})
}
}, [settings.tabSize, editorRef.current, justCreated])
return globalExtensions

View File

@ -300,7 +300,7 @@ export interface Settings {
useFour: string
contextType: string
textWrapping: string
tabSize: string
tabSize?: string
}
export interface SettingsState {
@ -401,7 +401,7 @@ export const initialSettingsState = {
useFour: 'disabled',
contextType: 'none',
textWrapping: 'disabled',
tabSize: '2'
tabSize: undefined
},
}