You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
setSelectionRanges also removes part of the string it has selected. #276
I am creating a snippet that automatically takes the function name below the cursor, and creates a documentation title from the function name.
The snippet creates the title as expected, but it for some reason removes parts of the line the function definition is on. I have narrowed it down to the setSelectionRanges. It seems that for some reason it deletes the selection.
I have tried to move the selection to the beginning of the document, just to make sure its not because its selected at the end of the snippet, but no matter what I do, the setSelectionRanges removes a part of the selection.
One possibility here is that these APIs are (unfortunately) not synchronous -- you might have better luck if you add a short Sys.sleep() call following the calls to setSelectionRanges and insertText.
Activity
kevinushey commentedon May 16, 2023
One possibility here is that these APIs are (unfortunately) not synchronous -- you might have better luck if you add a short
Sys.sleep()call following the calls to setSelectionRanges and insertText.