MCPcopy Create free account
hub / github.com/ActiveState/code / insert

Method insert

recipes/Python/577978_Text_Model/recipe-577978.py:59–64  ·  view source on GitHub ↗
(self, i, texel)

Source from the content-addressed store, hash-verified

57 return Group([l, c, r])
58
59 def insert(self, i, texel):
60 if isinstance(texel, Characters) and texel.style is self.style:
61 text = self.data[:i]+texel.data+self.data[i:]
62 return Characters(text, self.style)
63 a, b = self.split(i)
64 return Group([a, texel, b])
65
66
67

Callers

nothing calls this directly

Calls 3

splitMethod · 0.95
CharactersClass · 0.85
GroupClass · 0.85

Tested by

no test coverage detected