Activate nearest tab only if closing focused tab
Closes: #719 The nearest tab should only be focused if the currently focused tab is closed.
This commit is contained in:
parent
b9062e47d5
commit
108ba0dfe3
1 changed files with 4 additions and 2 deletions
|
|
@ -2769,8 +2769,10 @@ impl Application for App {
|
|||
if let Some(tab_model) = self.pane_model.active_mut() {
|
||||
let entity = entity_opt.unwrap_or_else(|| tab_model.active());
|
||||
|
||||
// Activate closest item
|
||||
if let Some(position) = tab_model.position(entity) {
|
||||
// Activate closest item if closing active tab
|
||||
if entity == tab_model.active()
|
||||
&& let Some(position) = tab_model.position(entity)
|
||||
{
|
||||
if position > 0 {
|
||||
tab_model.activate_position(position - 1);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue