parent
4ecd1314fd
commit
884eecfe6e
|
@ -169,15 +169,15 @@ class Application(object):
|
||||||
self.registers = {}
|
self.registers = {}
|
||||||
|
|
||||||
# initialize tab handlers
|
# initialize tab handlers
|
||||||
completer.set('path', completer.FileCompleter(self))
|
completer.set_completer('path', completer.FileCompleter(self))
|
||||||
completer.set('buffer', completer.BufferCompleter(self))
|
completer.set_completer('buffer', completer.BufferCompleter(self))
|
||||||
completer.set('command', completer.CommandCompleter(self))
|
completer.set_completer('command', completer.CommandCompleter(self))
|
||||||
completer.set('shell', completer.ShellCompleter(self))
|
completer.set_completer('shell', completer.ShellCompleter(self))
|
||||||
completer.set('config', completer.ConfigCompleter(self))
|
completer.set_completer('config', completer.ConfigCompleter(self))
|
||||||
completer.set('method', completer.MethodCompleter(self))
|
completer.set_completer('method', completer.MethodCompleter(self))
|
||||||
completer.set('register', completer.RegisterCompleter(self))
|
completer.set_completer('register', completer.RegisterCompleter(self))
|
||||||
completer.set('mode', completer.ModeCompleter(self))
|
completer.set_completer('mode', completer.ModeCompleter(self))
|
||||||
completer.set('token', completer.TokenCompleter(self))
|
completer.set_completer('token', completer.TokenCompleter(self))
|
||||||
|
|
||||||
# set up curses
|
# set up curses
|
||||||
self.win = curses.newwin(self.y, self.x, 0, 0)
|
self.win = curses.newwin(self.y, self.x, 0, 0)
|
||||||
|
@ -273,7 +273,7 @@ class Application(object):
|
||||||
self.complete_slot = None
|
self.complete_slot = None
|
||||||
|
|
||||||
def set_completer(self, datatype, comp):
|
def set_completer(self, datatype, comp):
|
||||||
completer.set(datatype, comp)
|
completer.set_completer(datatype, comp)
|
||||||
|
|
||||||
# this sets up a mode, as well as optionally adding information on when to
|
# this sets up a mode, as well as optionally adding information on when to
|
||||||
# auto-load the mode
|
# auto-load the mode
|
||||||
|
|
|
@ -3,11 +3,11 @@ import method, util
|
||||||
|
|
||||||
_completers = {}
|
_completers = {}
|
||||||
|
|
||||||
def set(name, completer):
|
def set_completer(name, completer):
|
||||||
global _completers
|
global _completers
|
||||||
_completers[name] = completer
|
_completers[name] = completer
|
||||||
|
|
||||||
def get(*args):
|
def get_completer(*args):
|
||||||
return _completers.get(*args)
|
return _completers.get(*args)
|
||||||
|
|
||||||
def find_common_string(candidates):
|
def find_common_string(candidates):
|
||||||
|
|
|
@ -52,7 +52,7 @@ class Argument(object):
|
||||||
vargs2[self.name] = self.coerce_to_type(v)
|
vargs2[self.name] = self.coerce_to_type(v)
|
||||||
app.close_mini_buffer()
|
app.close_mini_buffer()
|
||||||
method.execute(w, **vargs2)
|
method.execute(w, **vargs2)
|
||||||
tabber = completer.get(self.datatype)
|
tabber = completer.get_completer(self.datatype)
|
||||||
if d is not None:
|
if d is not None:
|
||||||
p = self.prompt + "(%s) " % (d)
|
p = self.prompt + "(%s) " % (d)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -85,9 +85,9 @@ class ShellTab(Method):
|
||||||
|
|
||||||
s1 = curr_t.string
|
s1 = curr_t.string
|
||||||
if(curr_i == 0) and '/' not in s1:
|
if(curr_i == 0) and '/' not in s1:
|
||||||
completer = completer.get['command']
|
completer = completer.get_completer['command']
|
||||||
else:
|
else:
|
||||||
completer = completer.get['path']
|
completer = completer.get_completer['path']
|
||||||
|
|
||||||
s2, exists, complete = completer.tab_string(s1, w)
|
s2, exists, complete = completer.tab_string(s1, w)
|
||||||
w.delete(Point(curr_t.x, curr_t.y), Point(curr_t.end_x(), curr_t.y))
|
w.delete(Point(curr_t.x, curr_t.y), Point(curr_t.end_x(), curr_t.y))
|
||||||
|
|
Loading…
Reference in New Issue