Bug 309980

Summary: Inconsistency when duplicating lines with the cursor in an empty line
Product: [Applications] kate Reporter: Gerald Senarclens de Grancy <oss>
Component: scriptingAssignee: KWrite Developers <kwrite-bugs-null>
Status: VERIFIED FIXED    
Severity: normal CC: i.zaufi
Priority: NOR    
Version: Git   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: http://commits.kde.org/kate/329b040fc8d7849d240d99f717b17f4b47ae4702

Description Gerald Senarclens de Grancy 2012-11-12 17:49:54 UTC
If the cursor is in the beginning of an empty line below the selection when duplicating, this line will be duplicated as well; this is inconsistent with non-empty lines

Reproducible: Always

Steps to Reproduce:
1. Create a file with three lines;
2. Write "1" on the first line, leave the second empty and write "3" on the last line
3. Put the cursor to the first position of the first line; hit [shift]+[down] to select the first line;
4. Use [ctrl]+[alt]+[down] to duplicate the selection
Actual Results:  
Two new lines are inserted. The document's content is
"""
1

1

3
"""

Expected Results:  
One new line is inserted. The document's content should be
"""
1
1

3
"""
Comment 1 Alex Turbov 2013-03-08 09:47:27 UTC
already fixed. the bug can be closed.
Comment 2 Alex Turbov 2013-03-08 21:04:02 UTC
fixed 4 months ago
Comment 3 Gerald Senarclens de Grancy 2013-03-10 18:36:53 UTC
Git commit cbe63dc7f435f991af74a7167ab721d5aac534ec by Gerald Senarclens de Grancy.
Committed on 10/03/2013 at 19:34.
Pushed by geralds into branch 'master'.

added regression test for Bug 309980

added a simple test that automatically executes the reproduction steps
as described in the bug

A  +4    -0    testdata/commands/utils/bug_309980/expected
A  +2    -0    testdata/commands/utils/bug_309980/input.js
A  +3    -0    testdata/commands/utils/bug_309980/origin
A  +3    -0    testdata/commands/utils/move_up_1/expected
A  +2    -0    testdata/commands/utils/move_up_1/input.js
A  +3    -0    testdata/commands/utils/move_up_1/origin

http://commits.kde.org/kate/cbe63dc7f435f991af74a7167ab721d5aac534ec
Comment 4 Gerald Senarclens de Grancy 2013-03-10 18:37:51 UTC
Verified the fix and added a regression test.
Comment 5 Gerald Senarclens de Grancy 2013-03-23 13:01:21 UTC
Git commit 8b0d6498ed9080f88b98a51167477b8b498af78b by Gerald Senarclens de Grancy.
Committed on 10/03/2013 at 19:34.
Pushed by geralds into branch 'KDE/4.10'.

added regression test for Bug 309980

added a simple test that automatically executes the reproduction steps
as described in the bug

A  +4    -0    testdata/commands/utils/bug_309980/expected
A  +2    -0    testdata/commands/utils/bug_309980/input.js
A  +3    -0    testdata/commands/utils/bug_309980/origin
A  +3    -0    testdata/commands/utils/move_up_1/expected
A  +2    -0    testdata/commands/utils/move_up_1/input.js
A  +3    -0    testdata/commands/utils/move_up_1/origin

http://commits.kde.org/kate/8b0d6498ed9080f88b98a51167477b8b498af78b