API: Set cursor position/view location?

Class sublime.View: sel() RegionSet Returns a reference to the selection. show(point, <show_surrounds>) Scroll the view to show the given point. show_at_center(point) Scroll the view to center on the point.

To read cursor(s) postion:

pos = view.sel()

To put the cursor(s) (selection) somewhere, simply modify the sel() RegionSet values:

view.sel().clear() view.sel().add(sublime.Region(pos))

Take care of multi-selection.

3 Likes