'Split too-long lines to fit the desired width of the Cell.
Args:
data (str): Text to adjust to the cell\'s width.
Returns:
adjusted data (str): The adjusted text.
Notes:
This also updates `raw_width`.'

def _fit_width(self, data):

    width = self.width
    adjusted_data = []
    for line in data:
        if (0 < width < m_len(line)):
            adjusted_data.extend([ANSIString((part + ANSIString('|n'))) for part in wrap(line, width=width, drop_whitespace=False)])
        else:
            adjusted_data.append(line)
    if self.enforce_size:
        excess = (len(adjusted_data) - self.height)
        if (excess > 0):
            adjusted_data = adjusted_data[:(- excess)]
            if (len(adjusted_data[(-1)]) > 3):
                adjusted_data[(-1)] = (adjusted_data[(-1)][:(-2)] + '..')
        elif (excess < 0):
            adjusted_data.extend(['' for _ in range(excess)])
    return adjusted_data
