Exemplo n.º 1
0
 def lucky_assist(self, prefix):
     names = self._calculate_proposals()
     selected = 0
     if prefix is not None:
         selected = lisp.prefix_numeric_value(prefix)
     if 0 <= selected < len(names):
         result = names[selected]
     else:
         lisputils.message('Not enough proposals!')
         return
     self._apply_assist(result)
Exemplo n.º 2
0
 def code_assist(self, prefix):
     names = self._calculate_proposals()
     if prefix is not None:
         arg = lisp.prefix_numeric_value(prefix)
         if arg == 0:
             arg = len(names)
         common_start = self._calculate_prefix(names[:arg])
         lisp.insert(common_start[self.offset - self.starting_offset:])
         self._starting = common_start
         self._offset = self.starting_offset + len(common_start)
     prompt = 'Completion for %s: ' % self.expression
     result = lisputils.ask_values(prompt, names,
                                   starting=self.starting, exact=None)
     self._apply_assist(result)
Exemplo n.º 3
0
 def prefix_value(self, prefix):
     return lisp.prefix_numeric_value(prefix)
Exemplo n.º 4
0
 def prefix_value(self, prefix):
     return lisp.prefix_numeric_value(prefix)