diff options
Diffstat (limited to 'helix-view/src/tree.rs')
-rw-r--r-- | helix-view/src/tree.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/helix-view/src/tree.rs b/helix-view/src/tree.rs index b068f4c7..522a79d7 100644 --- a/helix-view/src/tree.rs +++ b/helix-view/src/tree.rs @@ -526,6 +526,18 @@ impl Tree { } } + pub fn transpose(&mut self) { + let focus = self.focus; + let parent = self.nodes[focus].parent; + if let Content::Container(container) = &mut self.nodes[parent].content { + container.layout = match container.layout { + Layout::Vertical => Layout::Horizontal, + Layout::Horizontal => Layout::Vertical, + }; + self.recalculate(); + } + } + pub fn area(&self) -> Rect { self.area } |