Hi
I have both the autoCloseBrackets and autocomplete functionality enabled (I’m using the hintOptions option with an async hintFunction). Both work fine, but I’m trying to use them together.
My desired functionality is that a user would type an open quote " or ', the autoCloseBracketsEvent would fire, closing the quote correctly, and then autocomplete would fire, showing the autocomplete pane.
The state transitioning of the editor would be like this ("|" indicates the cursor) :
start -> |
user types open quote -> '|
autoCloseBrackets closes the quote -> '|'
autocomplete (through key event fires) -> '|(autocomplete pane here)'
The problem is that I need the autoCloseBrackets event to fall through (return CodeMirror.Pass). The fact that I want autocomplete to fire is incidental, more generally what I want is to have the ability to trigger an event (through a keyMap binding) AFTER autoCloseBrackets finishes that uses the same keyPress that autoCloseBrackets used.
The obvious hacky way to do that is to iterate through cm.state.keyMaps and find the event associated with ’ or " and modify it directly, but that’s terrible.
Is there / could there be a supported way for autoCloseBrackets to do what I’m looking for?
Thanks for your help!