Skip to content

Instantly share code, notes, and snippets.

@compleatang
Created February 16, 2013 21:38
Show Gist options
  • Save compleatang/4968845 to your computer and use it in GitHub Desktop.
Save compleatang/4968845 to your computer and use it in GitHub Desktop.
Sublime Plugin -- Find the cursor position and move it one position back
(row,col) = self.view.rowcol(self.view.sel()[0].begin())
target = self.view.text_point(row, col-1)
self.view.sel().clear()
self.view.sel().add(sublime.Region(target))
self.view.show(target)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment