Skip to content

Focus on selected file when opening diff view#118

Merged
actionshrimp merged 1 commit intomainfrom
feature/diff-view-initial-file
Feb 25, 2026
Merged

Focus on selected file when opening diff view#118
actionshrimp merged 1 commit intomainfrom
feature/diff-view-initial-file

Conversation

@actionshrimp
Copy link
Owner

Summary

  • When opening the diff viewer from the status buffer while on a specific file, the diff view now pre-selects that file instead of always starting on the first file in the list
  • Threads the existing initial_file mechanism (previously only used by 3-way diffs) through all diff actions: staged, unstaged, worktree, dwim, and the popup actions
  • Adds unit tests verifying file path passthrough in _diff_dwim

Test plan

  • All 1574 unit tests pass
  • All 631 e2e tests pass (55 suites)
  • make lint passes

When opening the diff viewer from the status buffer while the cursor is
on a specific file, the diff view now pre-selects that file instead of
always starting on the first file in the list. The existing initial_file
mechanism (previously only used by 3-way diffs) is now threaded through
all diff actions: staged, unstaged, worktree, and dwim.
@actionshrimp actionshrimp merged commit 1555134 into main Feb 25, 2026
3 checks passed
@actionshrimp actionshrimp deleted the feature/diff-view-initial-file branch February 25, 2026 10:43
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.

1 participant