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

Method insert

Lib/idlelib/sidebar.py:373–385  ·  view source on GitHub ↗
(self, index, chars, tags=None)

Source from the content-addressed store, hash-verified

371 self.callback = callback
372
373 def insert(self, index, chars, tags=None):
374 is_single_line = '\n' not in chars
375 if is_single_line:
376 before_displaylines = get_displaylines(self, index)
377
378 self.delegate.insert(index, chars, tags)
379
380 if is_single_line:
381 after_displaylines = get_displaylines(self, index)
382 if after_displaylines == before_displaylines:
383 return # no need to update the sidebar
384
385 self.callback()
386
387 def delete(self, index1, index2=None):
388 if index2 is None:

Callers

nothing calls this directly

Calls 3

get_displaylinesFunction · 0.85
insertMethod · 0.45
callbackMethod · 0.45

Tested by

no test coverage detected