From af4f9b0fec39cfb612fc988e86581daf40078660 2016-07-29 21:40:21 From: tmr232 Date: 2016-07-29 21:40:21 Subject: [PATCH] Improved Windows path completion. Removed `\` and `:` from the delimiter list for Windows, and stopped deleting `\` chars from paths on Windows. --- diff --git a/IPython/core/completer.py b/IPython/core/completer.py index 07bbbaa..87b13b1 100644 --- a/IPython/core/completer.py +++ b/IPython/core/completer.py @@ -216,7 +216,11 @@ def completions_sorting_key(word): class Bunch(object): pass -DELIMS = ' \t\n`!@#$^&*()=+[{]}\\|;:\'",<>?' +if sys.platform == 'win32': + DELIMS = ' \t\n`!@#$^&*()=+[{]}|;\'",<>?' +else: + DELIMS = ' \t\n`!@#$^&*()=+[{]}\\|;:\'",<>?' + GREEDY_DELIMS = ' =\r\n' @@ -729,7 +733,10 @@ class IPCompleter(Completer): return [text_prefix + cast_unicode_py2(protect_filename(f)) for f in self.glob("*")] # Compute the matches from the filesystem - m0 = self.clean_glob(text.replace('\\','')) + if sys.platform == 'win32': + m0 = self.clean_glob(text) + else: + m0 = self.clean_glob(text.replace('\\', '')) if has_protectables: # If we had protectables, we need to revert our changes to the