def get_visual_selection(lines, start, end):
    """Split an arbitrary selection of text between lines

    Args:
        lines  (list): Lines of text to be processed
        start (tuple): Coordinates of the start of a selection
                       in format (line, char)
        end   (tuple): Coordinates of the end of a selection
                       in format (line, char)
    Return:
        tuple of strings. (before, inside, after)
    """
    before = lines[0][:start[1]]
    after = lines[-1][end[1] + 1:]
    inside = '\n'.join(lines)[len(before):(-len(after)) or None]
    return (before, inside, after)