microsoft / microsoft/monaco-editor
[Bug] Passing only `autoIndent` to `updateOptions` is not applied
@hediet is already working on this.
Since Jan 3, 2023.
- Dominant language
- JavaScript
- Stars
- 46.8k
- Forks
- 4.1k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 1
Description
Reproducible in vscode.dev or in VS Code Desktop?
- Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
- Not reproducible in the monaco editor playground
Monaco Editor Playground Code
var editor = monaco.editor.create(document.getElementById('container'), {
autoIndent: 'advanced'
});
var advanced = true;
setInterval(() => {
editor.updateOptions({
autoIndent: advanced ? 'none' : 'advanced'
});
advanced = ! advanced;
console.log(editor.getOption(monaco.editor.EditorOption.autoIndent));
}, 1000);
Reproduction Steps
Just run the above code and type something includes indention.
Actual (Problematic) Behavior
The autoIndent in the EditorOptions looks updated, but behavior does not change.

Expected Behavior
Apply the autoIndent option to the editor immediately.
Additional Context
I found that the CursorConfiguration in ViewModel is not updated at ViewModel._onConfigurationChanged event because changing autoIndent option is not checked in CursorConfiguration.shouldRecreate().
https://github.com/microsoft/vscode/blob/main/src/vs/editor/common/viewModel/viewModelImpl.ts#L262
https://github.com/microsoft/vscode/blob/main/src/vs/editor/common/cursorCommon.ts#L88
(I'm not sure if this is the actual cause.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.