Skip to content

Commit

Permalink
allows auto_complete in on_modified to use auto_complete_delay setting
Browse files Browse the repository at this point in the history
  • Loading branch information
atomi committed Jun 25, 2012
1 parent 501aff0 commit 46d2ba5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions coldfusiontagcompletions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ class TagAttributeAutoComplete(sublime_plugin.EventListener):

def on_modified(self, view):
sel = view.sel()[0].a

if view.substr(sel - 1) == " ":
if any(s in view.scope_name(sel) for s in self.valid_scopes_tags):
t = view.settings().get("auto_complete_delay")
sublime.set_timeout(lambda:
view.run_command("auto_complete", { 'disable_auto_insert': True, 'next_completion_if_showing': False }), 50
)
view.run_command("auto_complete", {
'disable_auto_insert': True,
'next_completion_if_showing': False,
'api_completions_only': True}), t)


def on_query_completions(self, view, prefix, locations):
Expand Down

0 comments on commit 46d2ba5

Please sign in to comment.