def is_bolt_module(view): possible_starts = ['define\(', 'test\('] js = view.file_name() != None and view.file_name().endswith('.js') if js: dep_region = regions.deps(view) inj_region = regions.injs(view) def is_prefix(x): pos = view.find(x, 0) return pos != None and pos.begin() < dep_region.begin() if (dep_region != None and inj_region != None and dep_region.begin() < inj_region.begin()): defns = filter(is_prefix, possible_starts) if len(defns) == 0: return False else: return True return False
def deps(view): cursor = selection.point(view) return regions.deps(view).contains(cursor)
def _deps(view, edit, xs): region = regions.deps(view) view.replace(edit, region, _format_deps(xs))
def deps(view): region = regions.deps(view) return _region(view, region)