Refactor LiveText to use diff-match-patch#11500
Conversation
|
Cc @camlorn @feerrenrut @jcsteh @LeonarddeR @michaelDCurran. |
See test results for failed build of commit adb46d31a7 |
…h the character-based approach.
See test results for failed build of commit 8314eab57d |
See test results for failed build of commit fb60d6866e |
See test results for failed build of commit 9b3803405f |
LeonarddeR
left a comment
There was a problem hiding this comment.
Make sure to update the dependencies seciton of the readme
…changes in the middle of lines.
…y issues and to ease testing.
|
Don't have much to comment on here, but glad to know this might get improved in a meaningful fashion. It'd be nice if using nano wasn't very painful, as it is today. I'll make a point of testing once this lands. |
|
@codeofdusk there have been several changes in this pr. Does the description still match the current situation of the code? |
|
Yes – I've been keeping the description up-to-date as I've made changes. |
This should make it compatible with NVDA, otherwise Espeak wouldn't be and it's a fairly major component (it's under GPL3 and has a similar patent clause).
|
I'm closing the PR in its current form due to licence incompatibility. I'll open a new one that calls DMP in a separate process to avoid linking with NVDA. |
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>
Link to issue number:
Closes #3200. Closes #11498.
Summary of the issue:
LiveTextobjects use difflib to calculate text changes:Description of how this pull request fixes the issue:
This PR replaces difflib with diff-match-patch (DMP) for
LiveTextobjects, and changes diffing functions to operate at the string rather than line level.Testing performed:
Known issues with pull request:
NVDAHelper. Initial testing suggests that the C++ library is much faster in these cases.master).Change log entry:
== Bug Fixes ==
== Changes For Developers ==
LiveText._getTextLinesis deprecated. Now override _getText, which returns a string of all text in the object. (Refactor LiveText to use diff-match-patch #11500)LiveTextobjects now calculate diffs by character. Set_supportsDMPtoFalseto revert to the previous line-based diffing algorithm. (Refactor LiveText to use diff-match-patch #11500)