From 3729db253bd58e976dd7e4066d17cb18e13905a2 Mon Sep 17 00:00:00 2001 From: John Berquist Date: Mon, 25 Apr 2016 22:54:54 -0400 Subject: [PATCH] small fixes - prevent custom tag completions from throwing an error when tag name is missing - minihtml.py should use 'view.line()' api method --- src/custom_tags/__init__.py | 3 +++ src/minihtml.py | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/custom_tags/__init__.py b/src/custom_tags/__init__.py index 10ec4b4..1f9d9ed 100644 --- a/src/custom_tags/__init__.py +++ b/src/custom_tags/__init__.py @@ -24,6 +24,9 @@ def get_tags(view, prefix, position, info): return None def get_tag_attributes(view, prefix, position, info): + if not info["tag_name"]: + return None + if ":" in info["tag_name"] and info["project_name"] in custom_tags.projects: completion_list = get_tag_attribute_completions(info["project_name"], info["tag_name"]) if completion_list: diff --git a/src/minihtml.py b/src/minihtml.py index 2c23ef5..26865d0 100644 --- a/src/minihtml.py +++ b/src/minihtml.py @@ -15,10 +15,7 @@ def from_view(view, region = None): region.b = region.a + 5000 truncated = True - if view.substr(region.begin() - 1) != "\n": - region.a = view.find_by_class(region.begin(), False, sublime.CLASS_LINE_START) - if view.substr(region.end()) != "\n": - region.b = view.find_by_class(region.end(), True, sublime.CLASS_LINE_END) + region = view.line(region) color_scheme = get_color_scheme()