Repository: gitui-org/gitui (language: rust)

Issue:
File selector should jump back and highlight unstaged files
**Describe the bug**
When you make a commit from staged changes and actually do the commit so that the commit message popup closes, the file highlighter does not jump back into the unstaged changes section. It only does this when you use the arrow up/down keys.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to Status tab
2. Select unstaged changes and stage them
3. Create a commit and write a message and finish it. So the popup window with the commit message input closes
4. Now there is no file selector in the unstaged changes section only after you use the arrow key up/down

**Expected behavior**
I would expect that after a commit, at least the first item in the unstaged changes list is highlighted. So that you get a visual feedback where you are when you move the arrow keys up and down.



Discussion / hints:
Hi, may I give it a try?

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 05823362cf..b764154d5e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## Unreleased
 
+### Changed
+* After commit: jump back to unstaged area [[@tommady](https://github.com/tommady)] ([#2476](https://github.com/extrawurst/gitui/issues/2476))
+
 ## [0.27.0] - 2024-01-14
 
 **new: manage remotes**
diff --git a/src/popups/commit.rs b/src/popups/commit.rs
index 0b9a1958fe..4dcfc3241c 100644
--- a/src/popups/commit.rs
+++ b/src/popups/commit.rs
@@ -218,6 +218,7 @@ impl CommitPopup {
 
 			self.hide();
 			self.queue.push(InternalEvent::Update(NeedsUpdate::ALL));
+			self.queue.push(InternalEvent::StatusLastFileMoved);
 			self.input.clear();
 		}
 


Test patch: