Skip to content

Conversation

@josephxiao8
Copy link
Contributor

Fixes #234796

@josephxiao8
Copy link
Contributor Author

@microsoft-github-policy-service agree

@alexdima alexdima assigned alexdima and unassigned hediet Dec 10, 2025
Copilot AI review requested due to automatic review settings December 10, 2025 15:25
@vs-code-engineering vs-code-engineering bot added this to the December / January 2026 milestone Dec 10, 2025
Copy link
Contributor

Copilot AI left a 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 DeleteDuplicateLinesAction to use lines[lines.length - 1].length + 1 for 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)

@alexdima alexdima enabled auto-merge (squash) December 10, 2025 16:36
@alexdima alexdima merged commit ab93965 into microsoft:main Dec 12, 2025
22 of 23 checks passed
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

Successfully merging this pull request may close these issues.

Unexpected Final Selection After Running Delete Duplicate Lines

6 participants