Add quotes in autocomplete when filename contains brackets (#4528)

This commit is contained in:
Eleni E 2021-11-17 20:58:09 +02:00 committed by GitHub
parent b13298f3cd
commit a558f9cf47
Failed to generate hash of commit
2 changed files with 24 additions and 1 deletions

23
news/3766.rst Normal file
View file

@ -0,0 +1,23 @@
**Added:**
* <news item>
**Changed:**
* <news item>
**Deprecated:**
* <news item>
**Removed:**
* <news item>
**Fixed:**
* Add quotes in autocomplete when filename contains brackets
**Security:**
* <news item>

View file

@ -18,7 +18,7 @@ from xonsh.completers.tools import (
@xl.lazyobject
def PATTERN_NEED_QUOTES():
pattern = r'\s`\$\{\}\,\*\(\)"\'\?&#'
pattern = r'\s`\$\{\}\[\]\,\*\(\)"\'\?&#'
if xp.ON_WINDOWS:
pattern += "%"
pattern = "[" + pattern + "]" + r"|\band\b|\bor\b"