Bug 374163 - [PATCH] When dragging a text in forward direction a selection is "dragged" by a double distance
Summary: [PATCH] When dragging a text in forward direction a selection is "dragged" by...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.29.0
Platform: Arch Linux Linux
: HI normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-26 12:25 UTC by Serge Roussak
Modified: 2017-01-07 11:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: KDE Frameworks 5.30
Sentry Crash Report:


Attachments
The screenshots (42.41 KB, image/png)
2016-12-26 12:25 UTC, Serge Roussak
Details
The patch (1.76 KB, patch)
2016-12-26 12:27 UTC, Serge Roussak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Serge Roussak 2016-12-26 12:25:40 UTC
Created attachment 102998 [details]
The screenshots

When I select a text in the katepart-driven editor and try to drag it in forward direction then selection of the inserted text is shifted by the size of the dragged text. See the screenshots for explanation. At the first picture I had selected the 'Line 2'. At the second I tried to drag it to the empty line and it was dragged, but a selection is "jumped" at a somewhere unexpected place.
Comment 1 Serge Roussak 2016-12-26 12:27:15 UTC
Created attachment 102999 [details]
The patch
Comment 2 Dominik Haumann 2017-01-03 09:01:02 UTC
Indeed, from reading the code, it seems this issue already exists for years. Strange no one ever stumbled over this.
Comment 3 Dominik Haumann 2017-01-03 11:35:43 UTC
Pending review request with unit test: https://git.reviewboard.kde.org/r/129758/
Comment 4 Dominik Haumann 2017-01-07 11:15:53 UTC
Git commit a4ad36c174f498cc884acaefe01b8443f69f1d79 by Dominik Haumann.
Committed on 07/01/2017 at 11:15.
Pushed by dhaumann into branch 'master'.

Fix: Forward dragging text results in wrong selection

Thanks to Serge Roussak for the patch!

REVIEW: 129758

M  +67   -0    autotests/src/kateview_test.cpp
M  +2    -0    autotests/src/kateview_test.h
M  +8    -4    src/view/kateviewinternal.cpp

https://commits.kde.org/ktexteditor/a4ad36c174f498cc884acaefe01b8443f69f1d79