Merge pull request #1748 from laerus/andorcomplet

auto quote completion paths that contain 'and', 'or'
This commit is contained in:
Gil Forsyth 2016-09-21 10:51:17 -04:00 committed by GitHub
commit 09e66f631f
2 changed files with 5 additions and 2 deletions

View file

@ -8,6 +8,8 @@
**Fixed:** **Fixed:**
* Auto quote path completions if path contains 'and' or 'or'
* Completion now works on subcommands after pipe, ``&&``, ``||`` and so on. * Completion now works on subcommands after pipe, ``&&``, ``||`` and so on.
**Security:** None **Security:** None

View file

@ -11,9 +11,10 @@ from xonsh.completers.tools import get_filter_function
@xl.lazyobject @xl.lazyobject
def CHARACTERS_NEED_QUOTES(): def CHARACTERS_NEED_QUOTES():
cnq = ' `\t\r\n${}*()"\',?&' cnq = [' ', '`', '\t', '\r', '\n', '$', '{', '}', ','
'*', '(', ')', '"', "'", '?', '&', 'and', 'or']
if xp.ON_WINDOWS: if xp.ON_WINDOWS:
cnq += '%' cnq.append('%')
return cnq return cnq