Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
yshui committed Dec 1, 2023
1 parent 2584ce4 commit db1809c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ export async function applyTextEditorOptions(
typeof newOptions.tabSize === 'number'
) {
newOptions.indentSize = editor.options.indentSize
if (
newOptions.tabSize != editor.options.tabSize ||
newOptions.insertSpaces != editor.options.insertSpaces
) {
// Workaround vscode bug #199791, indentSize is not updated the first time around.
const subscription = window.onDidChangeTextEditorOptions(async e => {
if (e.options.tabSize === newOptions.tabSize) {
subscription.dispose()
editor.options = {
indentSize: newOptions.indentSize,
}
}
})
}
}
editor.options = newOptions

Expand Down

0 comments on commit db1809c

Please sign in to comment.