-
-
Notifications
You must be signed in to change notification settings - Fork 634
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
diff-match-patch for LiveText (PR #11639)
Refactor LiveText to use diff-match-patch via IPC with another process Changes diffing functions to operate at the string rather than line level. Adds diff-match-patch (DMP) as an optional diffing algorithm for LiveText objects. It is anticipated that DMP will become the default in a future NVDA release pending positive user testing. Unlike #11500, this PR does not import or dynamically link to DMP due to licensing issues. Instead, a Python application is run in another process that calls the DMP extension, and communicates over standard IO. Co-authored-by: Michael Curran <michaelDCurran@users.noreply.github.com> Co-authored-by: Reef Turner <feerrenrut@users.noreply.github.com>
- Loading branch information
1 parent
7e5ffde
commit 9889285
Showing
13 changed files
with
364 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,45 @@ | ||
#NVDAObjects/IAccessible/WinConsole.py | ||
#A part of NonVisual Desktop Access (NVDA) | ||
#This file is covered by the GNU General Public License. | ||
#See the file COPYING for more details. | ||
#Copyright (C) 2007-2019 NV Access Limited, Bill Dengler | ||
# A part of NonVisual Desktop Access (NVDA) | ||
# This file is covered by the GNU General Public License. | ||
# See the file COPYING for more details. | ||
# Copyright (C) 2007-2020 NV Access Limited, Bill Dengler | ||
|
||
import config | ||
|
||
from NVDAObjects.behaviors import KeyboardHandlerBasedTypedCharSupport | ||
from winVersion import isWin10 | ||
|
||
from . import IAccessible | ||
from ..window import winConsole | ||
|
||
class WinConsole(winConsole.WinConsole, IAccessible): | ||
"The legacy console implementation for situations where UIA isn't supported." | ||
pass | ||
|
||
class EnhancedLegacyWinConsole(KeyboardHandlerBasedTypedCharSupport, winConsole.WinConsole, IAccessible): | ||
""" | ||
A hybrid approach to console access, using legacy APIs to read output | ||
and KeyboardHandlerBasedTypedCharSupport for input. | ||
""" | ||
#: Legacy consoles take quite a while to send textChange events. | ||
#: This significantly impacts typing performance, so don't queue chars. | ||
_supportsTextChange = False | ||
|
||
|
||
class LegacyWinConsole(winConsole.WinConsole, IAccessible): | ||
""" | ||
NVDA's original console support, used by default on Windows versions | ||
before 1607. | ||
""" | ||
|
||
def _get_diffAlgo(self): | ||
# Non-enhanced legacy consoles use caret proximity to detect | ||
# typed/deleted text. | ||
# Single-character changes are not reported as | ||
# they are confused for typed characters. | ||
# Force difflib to keep meaningful edit reporting in these consoles. | ||
from diffHandler import get_difflib_algo | ||
return get_difflib_algo() | ||
|
||
|
||
def findExtraOverlayClasses(obj, clsList): | ||
if isWin10(1607) and config.conf['terminals']['keyboardSupportInLegacy']: | ||
from NVDAObjects.behaviors import KeyboardHandlerBasedTypedCharSupport | ||
clsList.append(KeyboardHandlerBasedTypedCharSupport) | ||
clsList.append(WinConsole) | ||
clsList.append(EnhancedLegacyWinConsole) | ||
else: | ||
clsList.append(LegacyWinConsole) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.