Exemplo n.º 1
0
 def _show_code_tips(self, pos):
     line = self.GetCurrentLine() + 1
     text = self.GetText().encode("utf-8")
     s = self.WordStartPosition(pos, 1)
     e = self.WordEndPosition(pos, 1)
     word = self.GetTextRange(s, e)
     kws = vimcomplete(word.strip()+'(', "", text, line)
     if len(kws) == 1:
         tip = kws[0]['info']
         self.CallTipSetBackground("#102010")
         if len(tip) > 512:
             tip = "%s ..." % tip[:512]
         self.CallTipShow(pos, tip)
Exemplo n.º 2
0
 def _show_code_completation(self, pos):
     line = self.GetCurrentLine() + 1
     #linetext, _ = self.GetCurLine()
     #self.AddText(u'.')
     text = self.GetText().encode("utf-8")
     s = self.WordStartPosition(pos, 1)
     e = self.WordEndPosition(pos, 1)
     word = self.GetTextRange(s, e)
     kws = vimcomplete(word.strip(), "", text, line)
     #print repr(kws)
     if kws:
         kw = map(lambda x: x['word'], kws)
         kw.sort()
         self.AutoCompSetSeparator(ord('|'))
         self.AutoCompSetIgnoreCase(False)
         self.AutoCompShow(0, "|".join(kw))