Only do partial matching with main CommandParser
This commit is contained in:
parent
ec869686c2
commit
4a7a2e61d3
@ -72,10 +72,12 @@ class CommandRunner(QObject):
|
|||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
_win_id: The window this CommandRunner is associated with.
|
_win_id: The window this CommandRunner is associated with.
|
||||||
|
_partial_match: Whether to allow partial command matches.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, win_id, parent=None):
|
def __init__(self, win_id, partial_match=False, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
self._partial_match = partial_match
|
||||||
self._win_id = win_id
|
self._win_id = win_id
|
||||||
|
|
||||||
def _get_alias(self, text):
|
def _get_alias(self, text):
|
||||||
@ -173,6 +175,7 @@ class CommandRunner(QObject):
|
|||||||
return self.parse(new_cmd, aliases=False, fallback=fallback,
|
return self.parse(new_cmd, aliases=False, fallback=fallback,
|
||||||
keep=keep)
|
keep=keep)
|
||||||
|
|
||||||
|
if self._partial_match:
|
||||||
cmdstr = self._completion_match(cmdstr)
|
cmdstr = self._completion_match(cmdstr)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -158,7 +158,8 @@ class MainWindow(QWidget):
|
|||||||
|
|
||||||
self._completion = completionwidget.CompletionView(self.win_id, self)
|
self._completion = completionwidget.CompletionView(self.win_id, self)
|
||||||
|
|
||||||
self._commandrunner = runners.CommandRunner(self.win_id)
|
self._commandrunner = runners.CommandRunner(self.win_id,
|
||||||
|
partial_match=True)
|
||||||
|
|
||||||
self._keyhint = keyhintwidget.KeyHintView(self.win_id, self)
|
self._keyhint = keyhintwidget.KeyHintView(self.win_id, self)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user