Applying duplicateLinesUp and duplicateLinesDown does not work for the first line alone and for selections containing the first line.
- create a document with 4 lines and write a single number on each line (1 on the first, 2 on the second, ...)
- move the cursor to the beginning of the first line
- trigger duplicateLinesDown [Ctrl]+[Alt]+[down]
- the document now has an additional line inserted before the prior second line; the content of the line should be the same as the first line (1)
- an empty line is inserted before the prior first line
- duplicateLinesUp doesn't do anything in the above scenario;
- if the selection spans more than one lines (eg. Lines 1 and 2 are entirely selected), both duplicateLinesUp and duplicateLinesDown duplicate a single line: the line below the current selection
Git commit 2627ac31573304bee5748d7043b97dee9439f46f by Christoph Cullmann.
Committed on 09/11/2012 at 20:31.
Pushed by cullmann into branch 'master'.
fix issue with duplicate line of first line in document
M +2 -2 part/script/data/commands/utils.js
Just verified Christoph's fix.
Gerald, are all issues with moveLineUp/Down and duplicateLineUp/Down now fixed? If not, please open another report, thanks!
Dominik, unfortunately, not everything is done yet. There are three issues left and I'll try to file proper bugs after work tonight. A short summary:
- http://commits.kde.org/kate/32da84eea27a461215624cc52da019392a08889e regresses moving to the last line.
- http://commits.kde.org/kate/32da84eea27a461215624cc52da019392a08889e also introduces a bug when moving after duplicating the first lines of a document
- I am aware of one last inconsistency when duplicating: if the cursor is in the beginning of an empty line below the selection, this line will be duplicated as well; this is inconsistent with non-empty lines
I hope to get around to create automatic tests for all of these asap.
@Alex: Can you have a look at comment #4, since these regressions were introduced by applying your patch :^) Would be cool if we can fix this again for KDE 4.10.