mirror of https://github.com/getcursor/cursor
Don't interfere with file indent configuration
parent
30cd758e39
commit
6987e4265d
|
@ -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
|
||||
|
|
|
@ -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
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue