From c12097de0893c59dbf113c1629ba271280f427e7 Mon Sep 17 00:00:00 2001 From: Nyx <144965845+nnyyxxxx@users.noreply.github.com> Date: Wed, 2 Oct 2024 03:19:30 -0400 Subject: [PATCH] apply changes proposed by adam round 2 Co-authored-by: Adam Perkowski --- tui/src/state.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tui/src/state.rs b/tui/src/state.rs index 2554d79f..9f2a70c1 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -519,6 +519,7 @@ impl AppState { } else { current + 1 }; + self.selection.select(Some(next)); } @@ -527,6 +528,7 @@ impl AppState { let current = self.selection.selected().unwrap_or(0); let max_index = if self.at_root() { len - 1 } else { len }; let next = if current == 0 { max_index } else { current - 1 }; + self.selection.select(Some(next)); } @@ -757,6 +759,7 @@ impl AppState { let len = self.tabs.len(); let current = self.current_tab.selected().unwrap_or(0); let next = if current + 1 >= len { 0 } else { current + 1 }; + self.current_tab.select(Some(next)); self.refresh_tab(); } @@ -765,6 +768,7 @@ impl AppState { let len = self.tabs.len(); let current = self.current_tab.selected().unwrap_or(0); let next = if current == 0 { len - 1 } else { current - 1 }; + self.current_tab.select(Some(next)); self.refresh_tab(); }