MCPcopy Index your code
hub / github.com/python/cpython / do

Method do

Lib/idlelib/undo.py:213–222  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

211 Command.__init__(self, index1, None, chars, tags)
212
213 def do(self, text):
214 self.marks_before = self.save_marks(text)
215 self.index1 = text.index(self.index1)
216 if text.compare(self.index1, ">", "end-1c"):
217 # Insert before the final newline
218 self.index1 = text.index("end-1c")
219 text.insert(self.index1, self.chars, self.tags)
220 self.index2 = text.index("%s+%dc" % (self.index1, len(self.chars)))
221 self.marks_after = self.save_marks(text)
222 ##sys.__stderr__.write("do: %s\n" % self)
223
224 def redo(self, text):
225 text.mark_set('insert', self.index1)

Callers

nothing calls this directly

Calls 4

save_marksMethod · 0.80
indexMethod · 0.45
compareMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected