After I create an EditorView with a lot of comprtaments (so I am able to reconfigure the language, the indent unit, and so on), it seems that the autoindent does not work with the
@codemirror/lang-python extension. Is that a bug or do I have to implement autoindent by myself? If so, do you have any pointer?
Does the problem occur here as well? If so, could you describe it a bit more precisely. If not, could you try to reduce your setup to the minimal code needed to cause the problem?
The problem does not occur in the “Try Codemirror” web page. However, if I simplify my code to create the editor the same way as in the web page, I still have the issue Oo. Something is definitely wrong on my side, trying to figure out what.
Are @lezer/python and @codemirror/lang-python on the latest version?
Yes, they’re up to date. I managed to get it work, it looks like I had some calls to
reconfigure that are responsible for the issue. I need to investigate more to understand what is going on exactly, I’ll keep you informed.
The error was definitely on my side, when reconfiguring, I was removing an element at an invalid index from keybinding, leading to the issue. Checking the validity of the index before removing the element fixes the problem, apologies for this issue.