fix other directions

This commit is contained in:
missing 2022-06-26 22:49:40 -05:00
parent dcb66a5bd7
commit 5dc4deae72
2 changed files with 6 additions and 1 deletions

View file

@ -1,4 +1,5 @@
#![warn(clippy::pedantic)]
#![allow(clippy::too_many_lines)]
use std::fmt::{Debug, Display};

View file

@ -163,7 +163,11 @@ impl XcrabWindowManager {
}),
};
let new_pane_key = self.rects.insert(new_pane);
let new_pane_key = if child_key == parent_key {
self.rects.insert_with_key(|key| Rectangle { parent: key, ..new_pane })
} else {
self.rects.insert(new_pane)
};
// create the new_pane -> child relationship
self.rects.get_mut(child_key).unwrap().parent = new_pane_key;