Skip to content

Commit 7bad1d4

Browse files
authored
Merge 657f601 into e82d24c
2 parents e82d24c + 657f601 commit 7bad1d4

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

source/speechDictHandler/__init__.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
from logHandler import log
99
import os
1010
import codecs
11+
import review
1112
import api
12-
import config
1313
from . import dictFormatUpgrade
1414
from .speechDictVars import speechDictsPath
1515

@@ -115,9 +115,25 @@ def sub(self, text):
115115
del self[index]
116116
return text
117117

118+
118119
def processText(text):
119120
if not globalVars.speechDictionaryProcessing:
120121
return text
122+
# #14689: older (IMPROVED and END_INCLUSIVE) UIA consoles have many blank lines, which slows processing to a halt
123+
focus = api.getFocusObject()
124+
try:
125+
# get TextInfo implementation for object review mode
126+
textInfo, obj = review.getObjectPosition(focus)
127+
except AttributeError: # no makeTextInfo
128+
textInfo = None
129+
# late import to prevent circular dependency
130+
# ConsoleUIATextInfo is used by IMPROVED and END_INCLUSIVE consoles
131+
from NVDAObjects.UIA.winConsoleUIA import ConsoleUIATextInfo
132+
if isinstance(textInfo, ConsoleUIATextInfo):
133+
stripText = text.rstrip()
134+
IGNORE_TRAILING_WHITESPACE_LENGTH = 100
135+
if len(text) - len(stripText) > IGNORE_TRAILING_WHITESPACE_LENGTH:
136+
text = stripText
121137
for type in dictTypes:
122138
text=dictionaries[type].sub(text)
123139
return text

user_docs/en/changes.t2t

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ This only worked for Bluetooth Serial ports before. (#14524)
5555
Instead NVDA reports that the link has no destination. (#14723)
5656
- Several stability fixes to input/output for braille displays, resulting in less frequent errors and crashes of NVDA. (#14627)
5757
- NVDA again recovers from many more situations such as applications that stop responding which previously caused it to freeze completely. (#14759)
58+
- When forcing UIA support with certain terminal and consoles, a bug is fixed which caused a freeze and the log file to be spammed. (#14689)
5859
-
5960

6061

0 commit comments

Comments
 (0)