Expected Final Selection After Running Delete Duplicate Lines#234799
Merged
alexdima merged 4 commits intomicrosoft:mainfrom Dec 12, 2025
Merged
Conversation
Contributor
Author
|
@microsoft-github-policy-service agree |
joshuaxiao13
approved these changes
Nov 28, 2024
devMaxMcCann
approved these changes
Dec 18, 2024
alexdima
approved these changes
Dec 10, 2025
Contributor
There was a problem hiding this comment.
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) |
aeschli
approved these changes
Dec 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #234796