summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-04-14 02:10:10 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-04-14 02:10:10 -0400
commit7b9b4bff3e71f0f502bff89534cc25c68dfc1d38 (patch)
treef49347880185d2c3fb66b55be13ca9383f0ac431 /cmd2.py
parentdaab800949272c5b6e6d950048559fe97c1aff7f (diff)
downloadcmd2-git-7b9b4bff3e71f0f502bff89534cc25c68dfc1d38.tar.gz
Changed opening quote check and comment for clarity
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd2.py b/cmd2.py
index 1373492a..b2351623 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 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: