CTRL+D gives selection not line
-
My Shortcut mapper defines CTRL+D as SCI_SELECTIONDUPLICATE and not as SCI_LINEDUPLICATE, whereas the edit menu defines CTRL+D as “Duplicate Current Line” (see the screen shot). I find this somewhat confusing, because CTRL+D indeed duplicates a selection and not necessarily the current line.
-
For some related discussion, see this N++ issue:
#5298: Shortcut and menu command mismatched mapping for SCI_SELECTIONDUPLICATE and SCI_LINEDUPLICATE.
-
@Alan-Kilborn Thank you. Two questions:
- How do you remember all this?
- The problem that you signaled as long ago as February 2019 has not been solved yet, do you know why?
For the time being I assigned sci_lineduplicate to ctrl+d, because the action agrees more with what I was used to.
-
I just contributed to that Issue:
====
The present behavior of SCI_DUPLICATESELECTION (default Ctrl+d) :
- If text is selected, dup it
- Else, dup the line containing the caret
is excellent.
I recommend that the menu invocation be changed to do the same, and that it’s description be changed to:
Duplicate Current Selection XOR Line
I can imagine a user selecting either text on a line or text spanning multiple lines, and then wanting/needing to dup only the line containing the caret, but only when the bluest of blue moons is floating in the night sky.
-
@Paul-Wormer said in CTRL+D gives selection not line:
The problem that you signaled as long ago as February 2019 has not been solved yet, do you know why?
Developers have a lot to do; have you seen the number of “open” issues?
Out of the open issues, they pick and choose what to work on. Obviously, they only work on what is interesting to them.
Apparently this issue is not interesting to them.
-
@Paul-Wormer said :
How do you remember all this?
Hmm, not sure.
My son says I can’t remember stuff that was said last week.
Of course he gets bad grades in math because he “can’t learn” the techniques…but he knows every little detail about the latest apple phone.
Maybe it’s about what’s important to you… -
@Neil-Schipper I did not know that sci_selectionduplicate had the double functionality that you describe. Now that I know it, I set ctrl+d back to it. I agree with you that the description in the popup menu should mention both functions.
-
@Paul-Wormer said in CTRL+D gives selection not line:
I did not know that sci_selectionduplicate had the double functionality that you describe
Many commands have slightly different functionality if a selection is active (or not) when invoked. Somewhat obviously, the command functionality involves the selection if one is active, typically limiting the command to operating on only the selection.
the description in the … menu should mention both functions
It might be cumbersome visually to see both types of functionality expressed in menu text.
-
-
Some further discussion on this topic is HERE.