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

Unexpected line duplication behavior #59

Closed
pewscorner opened this issue Jan 22, 2025 · 0 comments
Closed

Unexpected line duplication behavior #59

pewscorner opened this issue Jan 22, 2025 · 0 comments

Comments

@pewscorner
Copy link

When I run "Duplicate and increment all numbers" (or certain other operations) with a single selection, I would expect a copy of the selection (including newline characters) to be inserted at the cursor position. But what actually happens is that the selection is treated like a column, and a copy of that column is inserted as a new column to the right of the original column.

Example of original text with a single selection:
Image

Actual result after "Duplicate and increment all numbers":
Image

Expected result:
Image

Note that the final selection in the expected result above allows the operation to be repeated in a meaningful way - unlike the selection in the actual result.


In the case of multiple selections, the behavior is almost as expected, except that the final selection is still weird.

Example of original text with multiple selections:
Image

Actual result after "Duplicate and increment all numbers":
Image

Expected result:
Image


To summarize: The current behavior does not support line duplication at all - only column duplication. I propose to fix this so both line and column duplication is supported in the expected way, i.e. each selection should be duplicated along with any newlines it includes.

String Manipulation 0.7.25
VS Code 1.96.4
Windows 11

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

1 participant