From fe4b571b8cdb70305113e8e972763af8198e3cae Mon Sep 17 00:00:00 2001 From: Michael Sippel Date: Sat, 2 Nov 2024 19:21:10 +0100 Subject: [PATCH] lib-nested-tty: reactivate list-cursor widget via new TreeNavExt trait --- lib-nested-tty/src/edit_tree/cursor_widget.rs | 25 +++++++++++++++++-- lib-nested-tty/src/edit_tree/mod.rs | 2 +- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/lib-nested-tty/src/edit_tree/cursor_widget.rs b/lib-nested-tty/src/edit_tree/cursor_widget.rs index 2504428..4c2fa1f 100644 --- a/lib-nested-tty/src/edit_tree/cursor_widget.rs +++ b/lib-nested-tty/src/edit_tree/cursor_widget.rs @@ -1,5 +1,27 @@ +use { + r3vi::{ + view::{ + OuterViewPort + }, + buffer::vec::*, + projection::decorate_sequence::Separate + }, + nested::{ + edit_tree::{ + TreeNav + }, + editors::list::{ + ListCursorMode + } + }, + crate::{TerminalView, make_label, TerminalProjections} +}; -impl TreeNav { +pub trait TreeNavExt { + fn get_cursor_widget(&self) -> OuterViewPort; +} + +impl TreeNavExt for T { fn get_cursor_widget(&self) -> OuterViewPort { VecBuffer::with_data( vec![ @@ -30,4 +52,3 @@ impl TreeNav { .flatten() } } - diff --git a/lib-nested-tty/src/edit_tree/mod.rs b/lib-nested-tty/src/edit_tree/mod.rs index fdf1de4..fa78d3f 100644 --- a/lib-nested-tty/src/edit_tree/mod.rs +++ b/lib-nested-tty/src/edit_tree/mod.rs @@ -1,4 +1,4 @@ pub mod color; pub mod keymap; - +pub mod cursor_widget;