##// END OF EJS Templates
Fix file completion of commands with spaces in them.
Fernando Perez -
Show More
@@ -432,13 +432,12 b' class IPCompleter(Completer):'
432 432 current (as of Python 2.3) Python readline it's possible to do
433 433 better."""
434 434
435 #print 'Completer->file_matches: <%s>' % text # dbg
435 #io.rprint('Completer->file_matches: <%s>' % text) # dbg
436 436
437 437 # chars that require escaping with backslash - i.e. chars
438 438 # that readline treats incorrectly as delimiters, but we
439 439 # don't want to treat as delimiters in filename matching
440 440 # when escaped with backslash
441
442 441 if text.startswith('!'):
443 442 text = text[1:]
444 443 text_prefix = '!'
@@ -463,7 +462,7 b' class IPCompleter(Completer):'
463 462 # tab pressed on empty line
464 463 lsplit = ""
465 464
466 if lsplit != protect_filename(lsplit):
465 if not open_quotes and lsplit != protect_filename(lsplit):
467 466 # if protectables are found, do matching on the whole escaped
468 467 # name
469 468 has_protectables = 1
@@ -493,8 +492,7 b' class IPCompleter(Completer):'
493 492 matches = [text_prefix +
494 493 protect_filename(f) for f in m0]
495 494
496 #print 'mm',matches # dbg
497 #return single_dir_expand(matches)
495 #io.rprint('mm', matches) # dbg
498 496 return mark_dirs(matches)
499 497
500 498 def magic_matches(self, text):
@@ -689,7 +687,7 b' class IPCompleter(Completer):'
689 687 Index of the cursor in the full line buffer. Should be provided by
690 688 remote frontends where kernel has no access to frontend state.
691 689 """
692 #io.rprint('COMP1 %r %r %r' % (text, line_buffer, cursor_pos)) # dbg
690 #io.rprint('\nCOMP1 %r %r %r' % (text, line_buffer, cursor_pos)) # dbg
693 691
694 692 # if the cursor position isn't given, the only sane assumption we can
695 693 # make is that it's at the end of the line (the common case)
@@ -707,8 +705,7 b' class IPCompleter(Completer):'
707 705 magic_escape = self.magic_escape
708 706 self.full_lbuf = line_buffer
709 707 self.lbuf = self.full_lbuf[:cursor_pos]
710
711 #io.rprint('COMP2 %r %r %r' % (text, line_buffer, cursor_pos)) # dbg
708 #io.rprint('\nCOMP2 %r %r %r' % (text, line_buffer, cursor_pos)) # dbg
712 709
713 710 # Start with a clean slate of completions
714 711 self.matches[:] = []
General Comments 0
You need to be logged in to leave comments. Login now