Skip to content

Commit 514e2d5

Browse files
committed
Added more clarification to comment
1 parent ff83f21 commit 514e2d5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

cmd2.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,10 +1961,9 @@ def complete(self, text, state):
19611961
begidx = max(readline.get_begidx() - stripped, 0)
19621962
endidx = max(readline.get_endidx() - stripped, 0)
19631963

1964-
# We only break words on whitespace and quotes when tab completing.
1965-
# Therefore shortcuts become part of the text variable if there isn't a space after it.
1966-
# We need to remove it from text and update the indexes. This only applies if we are at
1967-
# the beginning of the line.
1964+
# Shortcuts are not word break characters when tab completing. Therefore shortcuts become part
1965+
# of the text variable if there isn't a word break, like a space, after it. We need to remove it
1966+
# from text and update the indexes. This only applies if we are at the the beginning of the line.
19681967
shortcut_to_restore = ''
19691968
if begidx == 0:
19701969
for (shortcut, expansion) in self.shortcuts:
@@ -2092,7 +2091,7 @@ def complete(self, text, state):
20922091
# then we must add an opening quote to the matches.
20932092
if common_prefix and ' ' in all_matches_str:
20942093

2095-
# Figure out what kind of quote to add
2094+
# Figure out what kind of quote to add and save it as the unclosed_quote
20962095
if '"' in all_matches_str:
20972096
unclosed_quote = "'"
20982097
else:

0 commit comments

Comments
 (0)