Skip to content

Auto return to the tree view if the last hunk in a file was staged#2906

Open
WaterWhisperer wants to merge 1 commit intogitui-org:masterfrom
WaterWhisperer:auto-return-to-tree-view
Open

Auto return to the tree view if the last hunk in a file was staged#2906
WaterWhisperer wants to merge 1 commit intogitui-org:masterfrom
WaterWhisperer:auto-return-to-tree-view

Conversation

@WaterWhisperer
Copy link
Copy Markdown
Contributor

This Pull Request fixes/closes #2748.

It changes the following:

  • auto return to the tree view after staging the last hunk from the status diff view
2026.04.12.16.40.45.webm

I followed the checklist:

  • I added unittests
  • I ran make check without errors
  • I tested the overall application
  • I added an appropriate item to the changelog

@WaterWhisperer
Copy link
Copy Markdown
Contributor Author

About unittests: I started by adding simple unit tests to the new helper function, but eventually removed it because it was redundant and affected the code layout of the status.rs itself.

@WaterWhisperer
Copy link
Copy Markdown
Contributor Author

#2748 also mentions the issue of jumping to the directory level instead of the first file in the directory, which is the file that follows, but I think it depends on personal habits, and in some cases it is necessary to stage the entire folder directly, and I feel that this is reasonable behavior for the user, "if I want to stage the file separately then I just need to move it to it", so I didn't make any changes to this part

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.

After staging, next unstaged change is janky

1 participant