Skip to content

Commit 3bdcdf2

Browse files
committed
Correcting when to add an opening quote
1 parent 514e2d5 commit 3bdcdf2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmd2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,9 +2087,9 @@ def complete(self, text, state):
20872087
# Join all matches into 1 string for ease of searching
20882088
all_matches_str = ''.join(self.completion_matches)
20892089

2090-
# If there is a common_prefix and any of the matches have a space,
2091-
# then we must add an opening quote to the matches.
2092-
if common_prefix and ' ' in all_matches_str:
2090+
# If there is a tab completion that will alter the text on the command line and
2091+
# any of the matches have a space, then we must add an opening quote to the matches.
2092+
if common_prefix != text and ' ' in all_matches_str:
20932093

20942094
# Figure out what kind of quote to add and save it as the unclosed_quote
20952095
if '"' in all_matches_str:

0 commit comments

Comments
 (0)