How can I disable auto closing of specific brackets? I have a java mode active and Monaco is auto closing '<' to '<>'
Asked
Active
Viewed 635 times
2 Answers
0
You can use the editor option autoClosingBrackets
/**
* Enable auto closing brackets.
* Defaults to true.
*/
autoClosingBrackets?: boolean;
You can use this option in the creation options or later:
// When creating the editor
var editor = monaco.editor.create(container, { autoClosingBrackets: false });
// -----------------------
// Changing the option at a later time
var editor = monaco.editor.create(container);
// ...
editor.updateOptions({ autoClosingBrackets: false });
![](../../users/profiles/4850393.webp)
Alex Dima
- 17,553
- 1
- 12
- 13
-
Thanks for your answer., yet, this disables ALL auto-close brackets unfortunately. I have found bug in the language definition of JAVA where ' – tomitrescak Mar 01 '17 at 21:40
0
The problem was in the language definition of JAVA, where < was set to autoclose. I had to remove that definition and all was working ok.
![](../../users/profiles/1348303.webp)
tomitrescak
- 903
- 10
- 21