'Divide the commandline text into chunks around the cursor position.
Return:
([parts_before_cursor], \'part_under_cursor\', [parts_after_cursor])'

def _partition(self):

    text = self._cmd.text()[len(self._cmd.prefix()):]
    if ((not text) or (not text.strip())):
        return ([], '', [])
    runner = runners.CommandRunner(self._win_id)
    result = runner.parse(text, fallback=True, keep=True)
    parts = [x for x in result.cmdline if x]
    pos = (self._cmd.cursorPosition() - len(self._cmd.prefix()))
    pos = min(pos, len(text))
    log.completion.debug('partitioning    {}    around    position    {}'.format(parts, pos))
    for (i, part) in enumerate(parts):
        pos -= len(part)
        if (pos <= 0):
            if part[(pos - 1):(pos + 1)].isspace():
                parts.insert(i, '')
            prefix = [x.strip() for x in parts[:i]]
            center = parts[i].strip()
            postfix = [x.strip() for x in parts[(i + 1):] if (not x.isspace())]
            log.completion.debug("partitioned:    {}    '{}'    {}".format(prefix, center, postfix))
            return (prefix, center, postfix)
