Unindenting lines from Autocomplete suggestion

In the project below, when selecting an EndApplication word from autocomplete suggestions, such as ENDIF, the line should be un-indented to match the base indentation of the Application from which the EndApplication word is ending, however this does not work at the moment. It currently works for EndApplication words that are typed in by the user using indentOnInput, but if there is a way to achieve a similar behaviour for words added from Autocomplete suggestions, that would be great.

You can view the code here
The editor website here
And an example of the issue below:

ezgif-4-b27a4995e2

Thanks for your help!

1 Like

That’s a good point. The below patch also allow autoindent on completion.

2 Likes

That’s perfect, thanks a lot! Please could you republish @codemirror/language on npm as well? Thanks

Done. (0.19.10)

2 Likes

This behaviour is broken for me again and I was able to track it down to this commit:

0.20.1 is working, but 0.20.2 not anymore. It’s probably just the missing input.complete user event that’s causing this.

This patch should repair that again.

1 Like

Thank you! I can confirm that autocomplete@0.20.3 fixes the issue.