Skip to content

Commit

Permalink
Fixed abbreviation preview in explicit mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeche committed Sep 20, 2020
1 parent 0e02075 commit 22a8d91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 3 additions & 1 deletion lib/abbreviation.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,9 @@ def is_enabled(view: sublime.View, pos: int, skip_selector=False) -> bool:
"Check if Emmet abbreviation tracking is enabled"
auto_mark = get_settings('auto_mark', False)

if auto_mark is False or (not skip_selector and not syntax.in_activation_scope(view, pos)):
# `auto_mark` could be a boolean or string, indicating type of allowed abbreviation:
# either `markup` or `stylesheet`
if auto_mark is False:
return False

if auto_mark is True:
Expand Down
9 changes: 0 additions & 9 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,6 @@ def on_activated(self, editor: sublime.View):
@main_view
def on_selection_modified(self, editor: sublime.View):
pos = get_caret(editor)

# NB: Use `skip_selector` here to check if tracking is enabled:
# in some tricky cases (like in SCSS/Sass package) syntax highlighter may
# produce ignored selector when user types more characters, which
# mistakenly leads to ignored selector event if tracker is available.
# https://github.com/emmetio/sublime-text-plugin/issues/44
if not abbreviation.is_enabled(editor, pos, True):
return

trk = abbreviation.handle_selection_change(editor, pos)

if trk:
Expand Down

0 comments on commit 22a8d91

Please sign in to comment.