Space interrupts autocompletion

Hey,

I want to do a autocompletion for sentences. If I press space during the autocompletion window the window closes. Is there a possibility to suppress the interruption?

Yes, the closeCharacters option (which can be set by passing an options object to showHint or setting the hintOptions editor option) determines which characters close the dialog. It defaults to /[\s()\[\]{};:>,]/, you could try setting it to that regexp without the \s.

1 Like

@marijn how can we achieve this in codemirror v6. I cannot find closeCharacters in v6 api. Can you please guide me here ?

This is mostly done with the validFor field in completion results. And of course by scanning back far enough in the completion logic itself.