summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/autocomplete_w.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/idlelib/autocomplete_w.py')
-rw-r--r--Lib/idlelib/autocomplete_w.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/idlelib/autocomplete_w.py b/Lib/idlelib/autocomplete_w.py
index fe7a6be..d3d1e69 100644
--- a/Lib/idlelib/autocomplete_w.py
+++ b/Lib/idlelib/autocomplete_w.py
@@ -26,9 +26,11 @@ DOUBLECLICK_SEQUENCE = "<B1-Double-ButtonRelease>"
class AutoCompleteWindow:
- def __init__(self, widget):
+ def __init__(self, widget, tags):
# The widget (Text) on which we place the AutoCompleteWindow
self.widget = widget
+ # Tags to mark inserted text with
+ self.tags = tags
# The widgets we create
self.autocompletewindow = self.listbox = self.scrollbar = None
# The default foreground and background of a selection. Saved because
@@ -69,7 +71,8 @@ class AutoCompleteWindow:
"%s+%dc" % (self.startindex, len(self.start)))
if i < len(newstart):
self.widget.insert("%s+%dc" % (self.startindex, i),
- newstart[i:])
+ newstart[i:],
+ self.tags)
self.start = newstart
def _binary_search(self, s):