feat(SublimeText2.EditorPackages): cache packages

This commit is contained in:
Iristyle
2013-04-04 08:55:15 -04:00
parent d65666cdfc
commit c3efdad2c2
274 changed files with 26863 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
"""Some utility functions for working with sublime.
"""
def text_at_line(view, line_num):
"""Return the content at line. None if out of boundary."""
if line_num < 0:
return None
max_line_num, _ = view.rowcol(view.size())
if line_num > max_line_num:
return None
point = view.text_point(line_num, 0)
line_region = view.line(point)
return view.substr(line_region)
def is_region_void(region):
if region == None:
return True
if region.a == -1 and region.b == -1:
return True
return False