'Insert chars before the character at index.'

def insert(self, index, chars):

    if (not chars):
        return
    chars = chars.splitlines(True)
    if (chars[(-1)][(-1)] == '\n'):
        chars.append('')
    (line, char) = self._decode(index, (-1))
    before = self.data[line][:char]
    after = self.data[line][char:]
    self.data[line] = (before + chars[0])
    self.data[(line + 1):(line + 1)] = chars[1:]
    self.data[((line + len(chars)) - 1)] += after
