mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #25209: rlcomplete now can add a space or a colon after completed keyword.
This commit is contained in:
parent
36b3fbb0ee
commit
8ace8e99b3
3 changed files with 17 additions and 4 deletions
|
@ -106,6 +106,12 @@ class Completer:
|
|||
n = len(text)
|
||||
for word in keyword.kwlist:
|
||||
if word[:n] == text:
|
||||
if word in {'finally', 'try'}:
|
||||
word = word + ':'
|
||||
elif word not in {'False', 'None', 'True',
|
||||
'break', 'continue', 'pass',
|
||||
'else'}:
|
||||
word = word + ' '
|
||||
matches.append(word)
|
||||
for nspace in [builtins.__dict__, self.namespace]:
|
||||
for word, val in nspace.items():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue