fix: focus list navigation back up the path
1 file changed, +10 -3
+10-3src/views/browser.rs
| @@ -355,9 +355,16 @@ impl BrowserView { | ||
| 355 | 355 | } else if !self.path.is_empty() { |
| 356 | 356 | self.filter.query.clear(); |
| 357 | 357 | if self.focus_mode { |
| 358 | - // In focus mode, H goes back to focus root | |
| 359 | - self.path.clear(); | |
| 360 | - self.selection = 0; | |
| 358 | + // Check if current path IS a focused item (one more pop = focus root) | |
| 359 | + let focused_idx = self.focused.iter().position(|fp| *fp == self.path); | |
| 360 | + if let Some(idx) = focused_idx { | |
| 361 | + // Back from a focused item → return to focus root, select that item | |
| 362 | + self.path.clear(); | |
| 363 | + self.selection = idx; | |
| 364 | + } else { | |
| 365 | + // Deeper than a focused item → normal go_up | |
| 366 | + self.go_up(); | |
| 367 | + } | |
| 361 | 368 | } else { |
| 362 | 369 | self.go_up(); |
| 363 | 370 | } |