diff --git a/source/NVDAObjects/behaviors.py b/source/NVDAObjects/behaviors.py index 7610c482795..ce3c932df67 100755 --- a/source/NVDAObjects/behaviors.py +++ b/source/NVDAObjects/behaviors.py @@ -416,6 +416,9 @@ def _reportNewLines(self, lines): and len(lines[0].strip()) < max(len(speech.curWordChars) + 1, 3) ): return + # Clear the typed word buffer for new text lines. + speech.clearTypedWordBuffer() + self._queuedChars = [] super()._reportNewLines(lines) def event_typedCharacter(self, ch): @@ -459,16 +462,6 @@ def script_flush_queuedChars(self, gesture): speech.clearTypedWordBuffer() gesture.send() - def _calculateNewText(self, newLines, oldLines): - hasNewLines = ( - self._findNonBlankIndices(newLines) - != self._findNonBlankIndices(oldLines) - ) - if hasNewLines: - # Clear the typed word buffer for new text lines. - speech.clearTypedWordBuffer() - self._queuedChars = [] - return super()._calculateNewText(newLines, oldLines) def _dispatchQueue(self): """Sends queued typedCharacter events through to NVDA.""" @@ -476,13 +469,6 @@ def _dispatchQueue(self): ch = self._queuedChars.pop(0) super().event_typedCharacter(ch) - def _findNonBlankIndices(self, lines): - """ - Given a list of strings, returns a list of indices where the strings - are not empty. - """ - return [index for index, line in enumerate(lines) if line] - class KeyboardHandlerBasedTypedCharSupport(EnhancedTermTypedCharSupport): """An EnhancedTermTypedCharSupport object that provides typed character support for