summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-04-13 22:49:17 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-04-13 22:49:17 -0400
commitff83f21522abd8cc2513ee564637615ffde97f0c (patch)
treed50ce89b40dd5769fb928f87424b97012f124301 /cmd2.py
parent202cc074d10f61742e22dcdcea217ee03cc3cc17 (diff)
downloadcmd2-git-ff83f21522abd8cc2513ee564637615ffde97f0c.tar.gz
Added comment
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd2.py b/cmd2.py
index ccddbbc3..8220cc6e 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -2016,6 +2016,8 @@ class Cmd(cmd.Cmd):
# Check if the token being completed has an opening quote
if raw_completion_token and raw_completion_token[0] in QUOTES:
+
+ # Since the token is still being completed, we know the opening quote is unclosed
unclosed_quote = raw_completion_token[0]
# readline still performs word breaks after a quote. Therefore something like quoted search
@@ -2092,12 +2094,11 @@ class Cmd(cmd.Cmd):
# Figure out what kind of quote to add
if '"' in all_matches_str:
- quote = "'"
+ unclosed_quote = "'"
else:
- quote = '"'
+ unclosed_quote = '"'
- unclosed_quote = quote
- self.completion_matches = [quote + match for match in self.completion_matches]
+ self.completion_matches = [unclosed_quote + match for match in self.completion_matches]
# Check if we need to remove text from the beginning of tab completions
elif text_to_remove: