summaryrefslogtreecommitdiff
path: root/qutebrowser/misc/earlyinit.py
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-03-18 15:15:22 +0100
committerFlorian Bruhin <me@the-compiler.org>2021-03-18 15:15:22 +0100
commit3d1f975391ef61a43490e93b4ce0c54fdd5c22ab (patch)
tree058b862985d6d99afc64dcdebe4994908feab061 /qutebrowser/misc/earlyinit.py
parentf3e604d7fbf2ceb8f15a92c5ba7c177c83ee4db1 (diff)
downloadqutebrowser-3d1f975391ef61a43490e93b4ce0c54fdd5c22ab.tar.gz
qutebrowser-3d1f975391ef61a43490e93b4ce0c54fdd5c22ab.zip
Move completion fallback handling out of CommandParser
This makes CompletionParser.parse simpler and makes ParseResult.cmd and .args non-Optional. Them being Optional would mean we would've to either resort to more complex typing with Literal, or to check whether they are really non-None everywhere. Since fallback=True is only used at one point, let's just handle this at the calling site instead. In theory, this changes the behavior when the cmdstr is empty and self._partial_match is set, because we now raise early and self._completion_match isn't called anymore. In practice, I think this shouldn't make a difference anywhere, and tests seem to agree. If cmdstr is empty and self._partial_match is False, the behavior should be the same, because objects.commands[''] will raise KeyError.
Diffstat (limited to 'qutebrowser/misc/earlyinit.py')
0 files changed, 0 insertions, 0 deletions