Skip to content

Commit

Permalink
Do not forcibly reset tracker on completion
Browse files Browse the repository at this point in the history
This allows users to complete abbreviations with words
  • Loading branch information
sergeche committed Oct 27, 2020
1 parent 1bdbc0a commit 12d021a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ def on_query_completions(self, editor: sublime.View, prefix: str, locations: lis
abbreviation.mark(editor, tracker)
abbreviation.show_preview(editor, tracker)
snippet = emmet_sublime.expand(tracker.abbreviation, tracker.config)
return [('%s\tEmmet' % tracker.abbreviation, snippet)]
return [('%s\tEmmet' % editor.substr(tracker.region), snippet)]
else:
abbreviation.stop_tracking(editor)
else:
Expand All @@ -528,10 +528,10 @@ def on_query_completions(self, editor: sublime.View, prefix: str, locations: lis
abbreviation.stop_tracking(editor)

def on_text_command(self, view: sublime.View, command_name: str, args: list):
if command_name == 'auto_complete' and abbreviation.is_enabled(view, get_caret(view)):
if command_name == 'auto_complete' and abbreviation.allow_tracking(view, get_caret(view)):
self.pending_completions_request = True
elif command_name in ('commit_completion', 'insert_best_completion'):
abbreviation.stop_tracking(view)
# elif command_name in ('commit_completion', 'insert_best_completion'):
# abbreviation.stop_tracking(view)

def on_post_text_command(self, editor: sublime.View, command_name: str, args: list):
if command_name == 'auto_complete':
Expand Down

0 comments on commit 12d021a

Please sign in to comment.