diff options
| author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-03-20 02:01:00 -0400 |
|---|---|---|
| committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-03-20 02:01:00 -0400 |
| commit | c1b8776b31cef22f8e47cd89f2d3fef266cbb8b7 (patch) | |
| tree | df8f69718706ca3f2ce3dbd31a71b3d85cb1341f | |
| parent | 7900be9b58d5e856d74c4498d37775056d548503 (diff) | |
| download | cmd2-git-c1b8776b31cef22f8e47cd89f2d3fef266cbb8b7.tar.gz | |
Renamed variable
| -rw-r--r-- | cmd2.py | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1512,12 +1512,12 @@ class Cmd(cmd.Cmd): # Get the status of quotes in the token being completed quotes = ['"', "'"] - token_being_completed = tokens[-1] + completion_token = tokens[-1] unclosed_quote = '' - if len(token_being_completed) > 1: - first_char = token_being_completed[0] - last_char = token_being_completed[-1] + if len(completion_token) > 1: + first_char = completion_token[0] + last_char = completion_token[-1] # Check if the token being completed has an unclosed quote if first_char in quotes and first_char != last_char: @@ -1558,13 +1558,13 @@ class Cmd(cmd.Cmd): # Check if we need to add an opening quote if len(self.completion_matches) > 0 and \ - (len(token_being_completed) == 0 or token_being_completed[0] not in quotes): + (len(completion_token) == 0 or completion_token[0] not in quotes): # Get the common prefix of all matches. This is what is added to the token being completed. common_prefix = os.path.commonprefix(self.completion_matches) # If anything that will be in the token being completed contains a space, then # we must add an opening quote to the token on screen - if ' ' in token_being_completed or ' ' in common_prefix: + if ' ' in completion_token or ' ' in common_prefix: # Mark that there is now an unclosed quote unclosed_quote = '"' @@ -1602,7 +1602,7 @@ class Cmd(cmd.Cmd): # the original values of begidx and endidx and we can't change them. Therefore we must # prepend to every match the character right before the text variable so it doesn't # get erased. - saved_char = token_being_completed[(len(text) + 1) * -1] + saved_char = completion_token[(len(text) + 1) * -1] self.completion_matches = [saved_char + match for match in self.completion_matches] # pyreadline specific way to insert an opening quote |
