diff --git a/HyperClick.sublime-settings b/HyperClick.sublime-settings index f3c4bba..e3bb331 100644 --- a/HyperClick.sublime-settings +++ b/HyperClick.sublime-settings @@ -4,8 +4,27 @@ "annotation_not_found_text": "×", "annotations_enabled": true, - // HyperClick is enabled when the current scope matches this selector - "selector": "source.js,source.ts,source.sass,source.scss,source.less,embedding.php,source.stylus,text.html,source.jstl,source.css,text.pug,source.sugarss,text.sugarml,source.nunjucks,source.jinja2,text.html.twig,source.dart,text.html.smarty", + // HyperClick is enabled when the current scope matches any of selectors + "selectors": [ + "embedding.php", + "source.css", + "source.dart", + "source.jinja2", + "source.js", + "source.jstl", + "source.less", + "source.nunjucks", + "source.sass", + "source.scss", + "source.stylus", + "source.sugarss", + "source.ts", + "text.html", + "text.html.smarty", + "text.html.twig", + "text.pug", + "text.sugarml", + ], // Supported languages // - each has at least a regex to match import statements diff --git a/hyper_click_command.py b/hyper_click_command.py index 3b3e6c7..3414cd5 100644 --- a/hyper_click_command.py +++ b/hyper_click_command.py @@ -71,7 +71,8 @@ def is_valid_line(self, line_content): def is_visible(self, event=None): view = self.view - selector = self.settings.get('selector') + selector = "(" + ")|(".join(self.settings.get('selectors')) + ")" + if not view.match_selector(view.sel()[0].b, selector): return False else: