##// END OF EJS Templates
alias completing only made for first item...
vivainio -
Show More
@@ -35,7 +35,7 b' def hnd_syscmd(line,mo):'
35 #return "%s = %s"
35 #return "%s = %s"
36 var = mo.group('varname')
36 var = mo.group('varname')
37 cmd = mo.group('cmd')
37 cmd = mo.group('cmd')
38 expr = make_quoted_expr(itpl("sc -l =$cmd"))
38 expr = make_quoted_expr(itpl("sc -lv =$cmd"))
39 return itpl('$var = _ip.magic($expr)')
39 return itpl('$var = _ip.magic($expr)')
40
40
41 def install_re_handler(pat, hnd):
41 def install_re_handler(pat, hnd):
@@ -342,8 +342,8 b' class IPCompleter(Completer):'
342 def protect_filename(s):
342 def protect_filename(s):
343 return "".join([(ch in protectables and '\\' + ch or ch)
343 return "".join([(ch in protectables and '\\' + ch or ch)
344 for ch in s])
344 for ch in s])
345
345
346 lbuf = self.get_line_buffer()[:self.readline.get_endidx()]
346 lbuf = self.lbuf
347 open_quotes = 0 # track strings with open quotes
347 open_quotes = 0 # track strings with open quotes
348 try:
348 try:
349 lsplit = shlex_split(lbuf)[-1]
349 lsplit = shlex_split(lbuf)[-1]
@@ -396,9 +396,13 b' class IPCompleter(Completer):'
396 return matches
396 return matches
397
397
398 def alias_matches(self, text):
398 def alias_matches(self, text):
399 """Match internal system aliases"""
399 """Match internal system aliases"""
400
400 #print 'Completer->alias_matches:',text,'lb',self.lbuf # dbg
401 #print 'Completer->alias_matches:',text # dbg
401
402 # if we are not in the first 'item', alias matching
403 # doesn't make sense
404 if ' ' in self.lbuf:
405 return []
402 text = os.path.expanduser(text)
406 text = os.path.expanduser(text)
403 aliases = self.alias_table.keys()
407 aliases = self.alias_table.keys()
404 if text == "":
408 if text == "":
@@ -525,6 +529,7 b' class IPCompleter(Completer):'
525
529
526 # don't apply this on 'dumb' terminals, such as emacs buffers, so we
530 # don't apply this on 'dumb' terminals, such as emacs buffers, so we
527 # don't interfere with their own tab-completion mechanism.
531 # don't interfere with their own tab-completion mechanism.
532 self.lbuf = self.get_line_buffer()[:self.readline.get_endidx()]
528 if not (self.dumb_terminal or self.get_line_buffer().strip()):
533 if not (self.dumb_terminal or self.get_line_buffer().strip()):
529 self.readline.insert_text('\t')
534 self.readline.insert_text('\t')
530 return None
535 return None
General Comments 0
You need to be logged in to leave comments. Login now