feat(ST2.EditorPackages): bump up all packages
- Refresh PackageCache with latest versions of everything
This commit is contained in:
@@ -35,6 +35,7 @@ class BracketRemove(bh_plugin.BracketPluginCommand):
|
||||
|
||||
self.left = None
|
||||
self.right = None
|
||||
self.nobracket = True
|
||||
|
||||
|
||||
def plugin():
|
||||
|
@@ -6,25 +6,38 @@ DEFAULT_TAGS = ["cfml", "html", "angle"]
|
||||
|
||||
class SelectBracket(bh_plugin.BracketPluginCommand):
|
||||
def run(self, edit, name, select='', tags=DEFAULT_TAGS):
|
||||
current_left, current_right = self.selection[0].begin(), self.selection[0].end()
|
||||
left, right = self.left, self.right
|
||||
first, last = left.end, right.begin
|
||||
if select == 'left':
|
||||
if name in tags and left.size() > 1:
|
||||
first, last = left.begin + 1, left.begin + 1
|
||||
if first == current_left and last == current_right:
|
||||
first, last = left.begin, left.begin
|
||||
else:
|
||||
first, last = left.end, left.end
|
||||
if first == current_left and last == current_right:
|
||||
first, last = left.begin, left.begin
|
||||
elif select == 'right':
|
||||
if left.end != right.end:
|
||||
if name in tags and left.size() > 1:
|
||||
first, last = right.begin + 1, right.begin + 1
|
||||
if first == current_left and last == current_right:
|
||||
first, last = right.end, right.end
|
||||
else:
|
||||
first, last = right.begin, right.begin
|
||||
if first == current_left and last == current_right:
|
||||
first, last = right.end, right.end
|
||||
else:
|
||||
# There is no second bracket, so just select the first
|
||||
if name in tags and left.size() > 1:
|
||||
first, last = left.begin + 1, left.begin + 1
|
||||
else:
|
||||
first, last = right.end, right.end
|
||||
if first == current_left and last == current_right:
|
||||
first, last = right.end, right.end
|
||||
elif first == current_left and last == current_right:
|
||||
first, last = left.begin, right.end
|
||||
|
||||
self.selection = [sublime.Region(first, last)]
|
||||
|
||||
|
@@ -5,8 +5,9 @@ def post_match(view, name, style, first, second, center, bfr, threshold):
|
||||
if first is not None:
|
||||
# Strip whitespace from the beginning of first bracket
|
||||
open_bracket = bfr[first.begin:first.end]
|
||||
print (open_bracket)
|
||||
if open_bracket != "do":
|
||||
m = re.match(r"^(\s*\b)[\w\W]*", open_bracket)
|
||||
m = re.match(r"(\s*\b)[\w\W]*", open_bracket)
|
||||
if m:
|
||||
first = first.move(first.begin + m.end(1), first.end)
|
||||
return first, second, style
|
||||
|
@@ -6,8 +6,14 @@ BracketRemove = ImpMod.import_from("bh_modules.bracketremove", "BracketRemove")
|
||||
class SwapBrackets(BracketRemove):
|
||||
def run(self, edit, name, remove_content=False, remove_indent=False, remove_block=False):
|
||||
offset = self.left.toregion().size()
|
||||
self.selection = [sublime.Region(self.left.begin, self.right.begin - offset)]
|
||||
selection = [sublime.Region(self.left.begin, self.right.begin - offset)]
|
||||
left = self.left.move(self.left.end, self.left.end)
|
||||
right = self.right.move(self.right.begin, self.right.begin)
|
||||
super(SwapBrackets, self).run(edit, name)
|
||||
self.selection = selection
|
||||
self.left = left
|
||||
self.right = right
|
||||
self.nobracket = False
|
||||
|
||||
|
||||
def plugin():
|
||||
|
Reference in New Issue
Block a user