summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-04-14 00:34:35 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-04-14 00:34:35 -0400
commit3bdcdf206c5f4078b0e91ba3ad3d3b1815931694 (patch)
tree20dfa4a22625a2b879d9a42f68ddaa9570db217d
parent514e2d57d205d5385c0b5714c1cf14770f7978a0 (diff)
downloadcmd2-git-3bdcdf206c5f4078b0e91ba3ad3d3b1815931694.tar.gz
Correcting when to add an opening quote
-rwxr-xr-xcmd2.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd2.py b/cmd2.py
index 166f4f04..fac8042e 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -2087,9 +2087,9 @@ class Cmd(cmd.Cmd):
# Join all matches into 1 string for ease of searching
all_matches_str = ''.join(self.completion_matches)
- # If there is a common_prefix and any of the matches have a space,
- # then we must add an opening quote to the matches.
- if common_prefix and ' ' in all_matches_str:
+ # If there is a tab completion that will alter the text on the command line and
+ # any of the matches have a space, then we must add an opening quote to the matches.
+ if common_prefix != text and ' ' in all_matches_str:
# Figure out what kind of quote to add and save it as the unclosed_quote
if '"' in all_matches_str: