sandpack
sandpack copied to clipboard
Feature request: set the cursor position on selecting a file
Propose API:
setActiveFile(path, line?, column?)
or
setActiveFile(path, { line, column }?)
Hi @danilowoz
I want this feature. Now, I'm struggling to set the cursor position.
Until this feature is released, I would like to know if there is a way to set the cursor.
Hey @hand-dot! You can set a new cursor position programmatically using the CodeMirror instance, here's an example: https://sandpack.codesandbox.io/docs/advanced-usage/components#advanced-usage
Hope it helps