Skip to content

Commit

Permalink
Re-implement consoleUIA._getTextLines using UIATextPattern.GetVisible…
Browse files Browse the repository at this point in the history
…Ranges. This may improve performance when large amounts of text are written to the console, but possibly at the cost of less reliable autoread (particularly when the screen is refreshed or scrolled).
  • Loading branch information
codeofdusk committed May 24, 2019
1 parent 19d7bfb commit 9d43eb0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/NVDAObjects/UIA/ConsoleUIA.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,6 @@ def script_clear_isTyping(self, gesture):
def _getTextLines(self):
# Filter out extraneous empty lines from UIA
# Todo: do this (also) somewhere else so they aren't in document review either
return self.makeTextInfo(textInfos.POSITION_ALL).text.strip().split("\r\n")
ptr = self.UIATextPattern.GetVisibleRanges()
res = [ptr.GetElement(i).GetText(-1) for i in range(ptr.length)]
return res

0 comments on commit 9d43eb0

Please sign in to comment.