-
Notifications
You must be signed in to change notification settings - Fork 37.3k
Expected Final Selection After Running Delete Duplicate Lines #234799
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
Expected Final Selection After Running Delete Duplicate Lines #234799
Conversation
|
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a selection column calculation bug in the "Delete Duplicate Lines" action. The issue occurred because the final selection's end column was using the string length directly instead of the proper 1-indexed column position (length + 1), which is the VS Code convention where getLineMaxColumn() returns lineLength + 1.
Key Changes
- Updated
DeleteDuplicateLinesActionto uselines[lines.length - 1].length + 1for the final selection's end column, aligning with VS Code's 1-indexed column system - Corrected test expectations to match the fixed selection behavior
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/vs/editor/contrib/linesOperations/browser/linesOperations.ts | Fixed final selection end column calculation by adding +1 to account for 1-indexed columns |
| src/vs/editor/contrib/linesOperations/test/browser/linesOperations.test.ts | Updated test expectations for selection end columns from length to length+1 (line "omicron" from 7→8, line "beta" from 4→5) |
Fixes #234796