diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-04-14 02:10:10 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-04-14 02:10:10 -0400 |
commit | 7b9b4bff3e71f0f502bff89534cc25c68dfc1d38 (patch) | |
tree | f49347880185d2c3fb66b55be13ca9383f0ac431 /cmd2.py | |
parent | daab800949272c5b6e6d950048559fe97c1aff7f (diff) | |
download | cmd2-git-7b9b4bff3e71f0f502bff89534cc25c68dfc1d38.tar.gz |
Changed opening quote check and comment for clarity
Diffstat (limited to 'cmd2.py')
-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 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: + # If the tab completion will extend the text on the command line and any of + # the matches have a space, then we will add an opening quote to the matches. + if len(common_prefix) > len(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: |