Skip to content

Conversation

@jiahaoxiang2000
Copy link
Contributor

@jiahaoxiang2000 jiahaoxiang2000 commented Jul 4, 2025

Summary

• Fixed git.diff.stageHunk command to work when invoked via keyboard shortcuts or command palette
• Added cursor-based hunk staging fallback when no UI context is provided
• Maintains backward compatibility with existing UI button behavior

Test plan

  • Open a file with git changes in diff view
  • Position cursor within a hunk
  • Run git.diff.stageHunk command via keyboard shortcut or command palette
  • Verify the hunk under cursor is staged
  • Test existing UI button behavior still works

Fixes #253895 #240935

The command now falls back to cursor-based hunk staging when no context
is provided, enabling keyboard users to stage hunks without manual selection.

Fixes microsoft#253895
@jiahaoxiang2000
Copy link
Contributor Author

@microsoft-github-policy-service agree

@lszomoru lszomoru assigned hediet and unassigned lszomoru Jul 8, 2025
@hediet hediet assigned lszomoru and hediet and unassigned hediet and lszomoru Jul 15, 2025
@hediet hediet enabled auto-merge (squash) July 15, 2025 09:16
@hediet
Copy link
Member

hediet commented Jul 15, 2025

Thanks for the PR!

@hediet hediet added this to the July 2025 milestone Jul 15, 2025
@hediet hediet merged commit 1ddf2e8 into microsoft:main Jul 22, 2025
17 checks passed
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants