summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/AutoCompleteWindow.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/idlelib/AutoCompleteWindow.py')
-rw-r--r--Lib/idlelib/AutoCompleteWindow.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/idlelib/AutoCompleteWindow.py b/Lib/idlelib/AutoCompleteWindow.py
index 8bed034..7f8adaf 100644
--- a/Lib/idlelib/AutoCompleteWindow.py
+++ b/Lib/idlelib/AutoCompleteWindow.py
@@ -118,8 +118,11 @@ class AutoCompleteWindow:
i = 0
while i < len(lts) and i < len(selstart) and lts[i] == selstart[i]:
i += 1
- while cursel > 0 and selstart[:i] <= self.completions[cursel-1]:
+ previous_completion = self.completions[cursel - 1]
+ while cursel > 0 and selstart[:i] <= previous_completion:
i += 1
+ if selstart == previous_completion:
+ break # maybe we have a duplicate?
newstart = selstart[:i]
self._change_start(newstart)