From c1d7e3a363a3641c3d1931632559d39ee4c7a89c Mon Sep 17 00:00:00 2001 From: Bill Dengler Date: Wed, 17 Jul 2019 00:08:23 +0800 Subject: [PATCH] Disable filtering when tab is pressed, as completions may be very short. --- source/NVDAObjects/UIA/winConsoleUIA.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/NVDAObjects/UIA/winConsoleUIA.py b/source/NVDAObjects/UIA/winConsoleUIA.py index cae4c4f8417..83f3068b006 100644 --- a/source/NVDAObjects/UIA/winConsoleUIA.py +++ b/source/NVDAObjects/UIA/winConsoleUIA.py @@ -236,12 +236,19 @@ class WinConsoleUIA(Terminal): #: Whether the console got new text lines in its last update. #: Used to determine if typed character/word buffers should be flushed. _hasNewLines = False + #: Whether the last typed character is a tab. + #: If so, we should temporarily disable filtering as completions may + #: be short. + _hasTab = False #: the caret in consoles can take a while to move on Windows 10 1903 and later. _caretMovementTimeoutMultiplier = 1.5 def _reportNewText(self, line): # Additional typed character filtering beyond that in LiveText - if len(line.strip()) < max(len(speech.curWordChars) + 1, 3): + if ( + not self._hasTab + and len(line.strip()) < max(len(speech.curWordChars) + 1, 3) + ): return if self._hasNewLines: # Clear the typed word buffer for new text lines. @@ -252,9 +259,12 @@ def _reportNewText(self, line): def event_typedCharacter(self, ch): if ch == '\t': + self._hasTab = True # Clear the typed word buffer for tab completion. # This will need to be changed once #8110 is merged. speech.curWordChars = [] + else: + self._hasTab = False if ( ( config.conf['keyboard']['speakTypedCharacters']