How to disable cursor "skipping" closing brackets when using closeBrackets extension

I am currently using the basicSetup configuration for bracket closing: CodeMirror Reference Manual

I would like to keep the auto-inserting behavior of closeBrackets, but I don’t want this part of the behavior:

When closing a bracket directly in front of a closing bracket inserted by the extension, the cursor moves over that bracket.

Is there a way I can configure the extension to do that? Or must I create a similar extension (autocomplete/src/closebrackets.ts at main · codemirror/autocomplete · GitHub)?

All automatic-bracket closing editors I am aware of work like this—and there’s a rather good reason for that. If you blindly type (), and the closing bracket wouldn’t get skipped, you’d end up with ()), which would be error-prone and just annoying. As such, I don’t think adding this as an option is a very useful feature.

I understand, the only reason why I was considering this behavior was due to the extension not always being consistent. When a user types brackets (or when the application programmatically executes insertBracket) , the skipping behavior is correctly behaving. However, when you save the document and reload the page with the same text, it does not retain the skipping behavior anymore.

It seems like the editor state is lost, and not reinitialized. Is that intentional? I suppose it would be quite complicated to reinitialize closed brackets based on pre-existing text.

This is intentional. It only skips brackets that it itself inserted recently. VS Code behaves the same way.