Skip to content

Commit

Permalink
using string operations to grab tag name for matching against diction…
Browse files Browse the repository at this point in the history
…ary key
  • Loading branch information
atomi committed Jun 25, 2012
1 parent 41bdbb4 commit 6c8c9f1
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions coldfusiontagcompletions.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,17 @@ def on_query_completions(self, view, prefix, locations):
completions = []

if any(s in view.scope_name(sel) for s in self.valid_scopes_tags):
scopestart = view.extract_scope(sel).a
if scopestart == sel:
scopestart = view.extract_scope(sel - 1).a
word = view.substr(view.word(scopestart + 1))
if word in self.cflib.completions.keys():
completions = self.cflib.completions[word]['completions']
for region in view.sel():
pos = region.begin()

tagdata = view.substr(sublime.Region(0, pos)).split("<")
tagdata.reverse()
tagdata = tagdata.pop(0).split(" ")
tagname = tagdata[0]

if tagname in self.cflib.completions.keys():
completions = self.cflib.completions[tagname]['completions']

if completions == []:
return
return (completions, sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS)

0 comments on commit 6c8c9f1

Please sign in to comment.