diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-04-14 00:34:35 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-04-14 00:34:35 -0400 |
commit | 3bdcdf206c5f4078b0e91ba3ad3d3b1815931694 (patch) | |
tree | 20dfa4a22625a2b879d9a42f68ddaa9570db217d | |
parent | 514e2d57d205d5385c0b5714c1cf14770f7978a0 (diff) | |
download | cmd2-git-3bdcdf206c5f4078b0e91ba3ad3d3b1815931694.tar.gz |
Correcting when to add an opening quote
-rwxr-xr-x | cmd2.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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: |