How to ace_performSelectionChange in plugin within aceKeyEvent hook #5647
Unanswered
alexfrench
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to replace the selected text with some newText - always the same number of characters. When I do this using ace_replaceRange, the selection is lost and I would like to reset it. The ace_performSelectionChange function appears to be the way to do this, however, when I call it I get an error "cannot set properties of null (setting 'repChanged'). What am I doing wrong? Code excerpt below. Thanks so much.
exports.aceKeyEvent = (hookName, call) => {
...
editorInfo.ace_replaceRange (selStart, selEnd, newText);
editorInfo.ace_performSelectionChange(selStart, selEnd, false); // reset the selection
}
Beta Was this translation helpful? Give feedback.
All reactions