From 68ae62756c537f67e3b64ab8ca434e34e10662ee Mon Sep 17 00:00:00 2001 From: laerus Date: Wed, 21 Sep 2016 17:31:11 +0300 Subject: [PATCH] auto quote completion paths that contain 'and', 'or' --- news/{complete-after-pipe.rst => completions.rst} | 2 ++ xonsh/completers/path.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) rename news/{complete-after-pipe.rst => completions.rst} (74%) diff --git a/news/complete-after-pipe.rst b/news/completions.rst similarity index 74% rename from news/complete-after-pipe.rst rename to news/completions.rst index 6ce477d38..585848d9f 100644 --- a/news/complete-after-pipe.rst +++ b/news/completions.rst @@ -8,6 +8,8 @@ **Fixed:** +* Auto quote path completions if path contains 'and' or 'or' + * Completion now works on subcommands after pipe, ``&&``, ``||`` and so on. **Security:** None diff --git a/xonsh/completers/path.py b/xonsh/completers/path.py index 36da72149..ee362203c 100644 --- a/xonsh/completers/path.py +++ b/xonsh/completers/path.py @@ -11,9 +11,10 @@ from xonsh.completers.tools import get_filter_function @xl.lazyobject def CHARACTERS_NEED_QUOTES(): - cnq = ' `\t\r\n${}*()"\',?&' + cnq = [' ', '`', '\t', '\r', '\n', '$', '{', '}', ',' + '*', '(', ')', '"', "'", '?', '&', 'and', 'or'] if xp.ON_WINDOWS: - cnq += '%' + cnq.append('%') return cnq