#4067 Duplicate Current Line inconsistency

Dave Smith


I've spotted a small inconsistency in "Duplicate Current Line".

Firstly it works fine with no selection: CTRL+D and "Edit > Line Operations > Duplicate Current Line" work exactly the same; the whole current line is duplicated.

However, when there is a multi-line selection "Edit > Line Operations > Duplicate Current Line" ignores the selection and duplicates the line where the cursor is. And CTRL+D duplicates the selection, not as a line operation, but true to the selection.

Neither is how I'd expect it to work on a multi-line selection, especially after becoming familiar with CTRL+D as a line duplicator.

With a multi-line selection I'd expect the "Duplicate Current Line" to duplicate all the lines (whole lines) starting at the line the selection starts in and ending at the line the selection ends in. The same as with no selection but with the ability to duplicate more than one line at a time.

ok I feel a bit stupid right now... after playing around a bit more I noticed that CTRL+D on a selection like a word duplicates the word. Hence, maybe the small inconsistency that I'm seeing. So, maybe then there is need to separate this functionality out a little and have two different commands/shortcuts:
1. "Duplicate Current Line(s)" CTRL+D for line duplications where the selection changes the number of lines to duplicate
2. "Duplicate Current Selection" CTRL+ALT+D or CTRL+SHIFT+D for text duplication where the exact selection is duplicated

Not sure if this really is a bug report now or a feature request. Anyway, hope the above helps in some way and makes sense!

all the best

Notepad++ 6.2.2 on Windows 7