'Get count and command from the current keystring.
Return:
A (count, command) tuple.'

def _split_count(self):

    if self._supports_count:
        (countstr, cmd_input) = re.match('^(\\d*)(.*)', self._keystring).groups()
        count = (int(countstr) if countstr else None)
        if ((count == 0) and (not cmd_input)):
            cmd_input = self._keystring
            count = None
    else:
        cmd_input = self._keystring
        count = None
    return (count, cmd_input)
