poboiko created this revision. poboiko added reviewers: Frameworks, dfaure. Herald added a project: Frameworks. poboiko requested review of this revision.
REVISION SUMMARY Due to Qt bug 83605, it's not a good idea to `setTextCursor` while the cursor is inside `beginEditBlock / endEditBlock` (scrollbar might jump to the top), see KDE bug 195828. It's sufficient to move `setTextCursor` outside to fix it. (it's never too late... :) This patch also adds a test for this case (which currently fails due to regression, see D28819: [KRichTextEdit] Always treat key press as single modification in undo stack <https://phabricator.kde.org/D28819> and D28964: [KRichTextWidget] Remove ancient workaround and fix regression (commit 1d1eb6f) <https://phabricator.kde.org/D28964> for the fix). BUG: 195828 TEST PLAN 1. Apply D28964: [KRichTextWidget] Remove ancient workaround and fix regression (commit 1d1eb6f) <https://phabricator.kde.org/D28964> 2. `ctest` REPOSITORY R310 KTextWidgets BRANCH dont-scroll-rule (branched from master) REVISION DETAIL https://phabricator.kde.org/D28966 AFFECTED FILES autotests/krichtextedittest.cpp autotests/krichtextedittest.h src/widgets/krichtextedit.cpp To: poboiko, #frameworks, dfaure Cc: kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns