summaryrefslogtreecommitdiffstats
path: root/src/app
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2021-06-02 16:34:32 +0200
committerCanop <cano.petrole@gmail.com>2021-06-02 16:34:32 +0200
commit81771d1553d4414c4e87a76e13a734f61a4834f5 (patch)
tree69b64a9b5512fc5f600cd1bd2014fe5e0f505130 /src/app
parent424023b4b084e071ecf67fc719db56ce40a01345 (diff)
:toggle_second_tree closes an inactive tree instead of rightest
Fix #388
Diffstat (limited to 'src/app')
-rw-r--r--src/app/app.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/app/app.rs b/src/app/app.rs
index cfd8aae..4fb457d 100644
--- a/src/app/app.rs
+++ b/src/app/app.rs
@@ -389,7 +389,7 @@ impl App {
.filter(|p| p.state().get_type() == PanelStateType::Tree)
.count();
if trees_count < 2 {
- // we open a tree, closing a panel if necessary
+ // we open a tree, closing a (non tree) panel if necessary
if panels_count >= con.max_panels_count {
for i in (0..panels_count).rev() {
if self.panels[i].state().get_type() != PanelStateType::Tree {
@@ -419,9 +419,12 @@ impl App {
}
}
} else {
- // we close the rightest tree
+ // we close the rightest inactive tree
for i in (0..panels_count).rev() {
if self.panels[i].state().get_type() == PanelStateType::Tree {
+ if i == self.active_panel_idx {
+ continue;
+ }
self.close_panel(i);
break;
}