Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
#coding: utf8
#################################### IMPORTS ###################################
# Sublime Libs
import sublime
import sublime_plugin
################################################################################
class ExpandselectionCommand(sublime_plugin.TextCommand):
def run(self, edit, direction="left"):
view = self.view
for sel in view.sel():
if direction == "left":
if sel.b > sel.a:
na = sel.b
nb = sel.a
else:
na = sel.a
nb = sel.b-1
else:
if sel.b < sel.a:
na = sel.b
nb = sel.a
else:
na = sel.a
nb = sel.b+1
view.sel().add(sublime.Region(na, nb))
view.show(view.sel())
################################################################################
[
{
"keys": ["ctrl+left"],
"command": "expandselection",
"args": {
"direction": "left"
}
},
{
"keys": ["ctrl+right"],
"command": "expandselection",
"args": {
"direction": "right"
}
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.