diff options
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r-- | helix-view/src/editor.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index b2408eb9..a4ce2aca 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -172,6 +172,12 @@ impl Editor { self.tree.is_empty() } + pub fn current(&mut self) -> (&mut View, &mut Document) { + let view = self.tree.get_mut(self.tree.focus); + let doc = &mut self.documents[view.doc]; + (view, doc) + } + pub fn view(&self) -> &View { self.tree.get(self.tree.focus) } |