Skip to content

Instantly share code, notes, and snippets.

@wrenoud
Created November 9, 2012 20:45
Show Gist options
  • Save wrenoud/4048131 to your computer and use it in GitHub Desktop.
Save wrenoud/4048131 to your computer and use it in GitHub Desktop.
Select Line
import editor
text = editor.get_text()
selection = editor.get_line_selection()
selected_text = text[selection[0]:selection[1]]
editor.set_selection(selection[0], selection[0] + len(selected_text) - 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment