Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Duplicate selected lines, new command #15113

Open
1 task done
victorel-petrovich opened this issue May 9, 2024 · 1 comment
Open
1 task done

[Feature request] Duplicate selected lines, new command #15113

victorel-petrovich opened this issue May 9, 2024 · 1 comment

Comments

@victorel-petrovich
Copy link

victorel-petrovich commented May 9, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Description of the Issue

Currently there's no command that will duplicated a group of (consecutive) lines after partially or fully selecting them (using mouse and drag or say shift-arrow keys).
The resulting new group of lines should be an exact copy of the selected group of lines and placed below it, from new line.

Describe the solution you'd like.

A new command that will extend the the action performed by SCI_LINEDUPLICATE, and will duplicate any lines coloured/touched by the current selection, including the line where the cursor ends up.

This command could be put in Shortcut Mapper > Main menu.

It could also be put in Menu > Edit > Line Operations, either to replace "Duplicate current line" with "Duplicate current line(s)" , or as an additional entry "Duplicate selected lines".

Debug Information

Notepad++ v8.6.5   (32-bit)
Build time : Mar 29 2024 - 17:02:48
Path : C:\Users\...\AppData\npp\notepad++.exe
Command Line : "..."
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
Periodic Backup : ON
OS Name : Windows 10 Home (32-bit
OS Version : 22H2
OS Build : 19045.3803
Current ANSI codepage : 1252
Plugins : 
    mimeTools (3.1)
    NppConverter (4.6)
    NppExport (0.4)

Anything else?

The alternative is more time-consuming: make sure the selection starts at beginning of first line and ends at the beginning of the line after the last line, or in the reverse direction.

@alankilborn
Copy link
Contributor

IMO selecting the lines (fully) and executing SCI_SELECTIONDUPLICATE (default: Ctrl+d) is sufficient.

For fully implementing the suggested idea, scripting it is a good option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants