Skip to content

Commit

Permalink
Merge branch 'refactor/readable-selectors' of https://github.com/jfch…
Browse files Browse the repository at this point in the history
…erng-sublime/ST-HyperClick into jfcherng-sublime-refactor/readable-selectors

# Conflicts:
#	hyper_click_command.py
  • Loading branch information
cristianl committed Nov 1, 2020
2 parents 7e7ff82 + 54a6852 commit 4bb976f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
23 changes: 21 additions & 2 deletions HyperClick.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion hyper_click_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4bb976f

Please sign in to comment.