Fix highlighting when editing in patch review
Summary:
Problems:
- removing markers in foreach loop lead to crash (BUG 380125)
- highlighting when editing in patch review was broken
- reloading would stop the highlighting
Fixes:
- textInserted/textRemoved signals only send line-by-line (or character-by-character) changes and there are extra signals for newline insertion/removal. The patch reflects this mechanism.
- Redo the highlighting when the document is reloaded.
- Remove one of the duplicated lists of ranges (mainly to improve maintainability).
Persisting Issue:
- possible dangling mark when removing the "wrong" newline from a set of newline-only-lines changes.
BUG: 380125
Test Plan:
- tested text insertion, text removal and mark clicking and the combination of those with (mostly) consistent results for a git diff
Reviewers: KDevelop, apol
Reviewed By: KDevelop, apol
Subscribers: kdevelop-devel
Differential Revision: https://phabricator.kde.org/D6398