'This function takes a slice() object.
Slices have to be handled specially. Not only are they able to specify
a start and end with [x:y], but many forget that they can also specify
an interval with [x:y:z]. As a result, not only do we have to track
the ANSI Escapes that have played before the start of the slice, we
must also replay any in these intervals, should they exist.
Thankfully, slicing the _char_indexes table gives us the actual
indexes that need slicing in the raw string. We can check between
those indexes to figure out what escape characters need to be
replayed.'

def _slice(self, slc):

    slice_indexes = self._char_indexes[slc]
    if (not slice_indexes):
        return ANSIString('')
    try:
        string = self[slc.start]._raw_string
    except IndexError:
        return ANSIString('')
    last_mark = slice_indexes[0]
    i = None
    for i in slice_indexes[1:]:
        for index in range(last_mark, i):
            if (index in self._code_indexes):
                string += self._raw_string[index]
        last_mark = i
        try:
            string += self._raw_string[i]
        except IndexError:
            pass
    if (i is not None):
        append_tail = self._get_interleving((self._char_indexes.index(i) + 1))
    else:
        append_tail = ''
    return ANSIString((string + append_tail), decoded=True)
