Place the cursor and scroll to a given line and column number?

Is there are way to programmatically place the cursor and scroll to a given line and column number? Or, is the only way to do this using a position?

Currently, the API only supports calculating by positions, so if you’d like to jump to a specific line number, you’ll unfortunately have to make the calculation yourself by counting line breaks. I know this isn’t ideal, and we’re actively looking for how we’d like to improve the API around this.

1 Like

Row-Column addressing is the coordinate system in the language server protocol, so I’m sure there are conversions in Nova that might one day be exposed. In the meantime, the conversion is DIY, for example from the excellent TypeScript extension.

Removing APIs is so much more disruptive than adding them, so I do appreciate a careful and conservative approach here on Panic’s side.