Bug 309978 - Regression: Moving lines from the top constantly extends selection
Summary: Regression: Moving lines from the top constantly extends selection
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: scripting (show other bugs)
Version: Git
Platform: Compiled Sources Linux
: NOR minor
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-12 17:39 UTC by Gerald Senarclens de Grancy
Modified: 2013-04-23 22:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.10.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Senarclens de Grancy 2012-11-12 17:39:18 UTC
Moving lines from the top constantly extends selection which leads to inverting the lines of the document.

Reproducible: Always

Steps to Reproduce:
1. Create a document with five lines
2. Write "1" on the first line, "2" on the second, ... "5" on the last
3. Place the cursor in the first line and hit [Shift]+[down] to select the first line (the cursor is then on the first column of the second line)
4. Use [ctrl]+[shift]+[down] repeatedly
Actual Results:  
The line with the cursor is moved to the top of the line and included in the selection. After applying [ctrl]+[shift]+[down] the order of lines in the document will be inverted.

Expected Results:  
the first line gets moved down once for each [ctrl]+[shift]+[down]

This regression was introduced with http://commits.kde.org/kate/32da84eea27a461215624cc52da019392a08889e
Comment 1 Alex Turbov 2012-11-12 17:51:46 UTC
can't reproduce.
can you please try it w/ `utils.js' taken from the current master of kate.git?
Comment 2 Gerald Senarclens de Grancy 2012-11-12 18:16:59 UTC
That's exactly the version I used; (pulled from git, made a fresh built and installed it). Maybe the issue is that utils.js requires range.js:
require ("range.js");
which is installed in libraries/range.js?
Comment 3 Gerald Senarclens de Grancy 2012-11-13 07:50:00 UTC
Alex: I just made a fresh checkout and made sure the correct utils.js is used - and the bug nicely reproduces. If you still have trouble reproducing, I could create you a screencast.
Comment 4 Gerald Senarclens de Grancy 2013-03-14 13:16:59 UTC
Git commit 0f5a3ef7ecfc4072349413e23a9c102afd4208c8 by Gerald Senarclens de Grancy.
Committed on 14/03/2013 at 14:15.
Pushed by geralds into branch 'master'.

added automated TC for bug 309978

A  +4    -0    testdata/commands/utils/bug_309978/expected
A  +3    -0    testdata/commands/utils/bug_309978/input.js
A  +4    -0    testdata/commands/utils/bug_309978/origin

http://commits.kde.org/kate/0f5a3ef7ecfc4072349413e23a9c102afd4208c8
Comment 5 Gerald Senarclens de Grancy 2013-03-14 13:22:18 UTC
Just had a look and saw that the bug still reproduces. As described in the steps to reproduce, it is necessary that the first line is _selected_ for the bug to reproduce (see step three or the automated regression test I just wrote for this bug).
Comment 6 Alex Turbov 2013-03-14 15:50:12 UTC
Git commit e6d80322e56c6e0db450f375328220ca405c151e by Alex Turbov.
Committed on 14/03/2013 at 16:49.
Pushed by turbov into branch 'master'.

M  +6    -0    part/script/data/commands/utils.js

http://commits.kde.org/kate/e6d80322e56c6e0db450f375328220ca405c151e
Comment 7 Alex Turbov 2013-03-14 15:55:26 UTC
I got it.
fixed in master... it seems test case for bug_309978 works now as expected. can you confirm?
(it is too much debug info while tests executed -- hard to see thats going on :)
Comment 8 Gerald Senarclens de Grancy 2013-03-14 15:58:53 UTC
Thanks Alex. Works nicely when testing manually and the regression test now passes as well :)
Comment 9 Alex Turbov 2013-03-14 16:02:22 UTC
Git commit b7a1e37353a7d4ac1fe0d8cc6a20daec9727d31f by Alex Turbov.
Committed on 14/03/2013 at 16:49.
Pushed by turbov into branch 'KDE/4.10'.

M  +6    -0    part/script/data/commands/utils.js

http://commits.kde.org/kate/b7a1e37353a7d4ac1fe0d8cc6a20daec9727d31f
Comment 10 Gerald Senarclens de Grancy 2013-03-23 13:01:16 UTC
Git commit f4618fc1faef90c3cea274d01d01fe58c1c7a615 by Gerald Senarclens de Grancy.
Committed on 14/03/2013 at 14:15.
Pushed by geralds into branch 'KDE/4.10'.

added automated TC for bug 309978

A  +4    -0    testdata/commands/utils/bug_309978/expected
A  +3    -0    testdata/commands/utils/bug_309978/input.js
A  +4    -0    testdata/commands/utils/bug_309978/origin

http://commits.kde.org/kate/f4618fc1faef90c3cea274d01d01fe58c1c7a615