From 170dfcf01c3105c1a39234a9b8724dd3a0ad4fb0 Mon Sep 17 00:00:00 2001 From: Michael Sippel Date: Mon, 21 Aug 2023 14:13:13 +0200 Subject: [PATCH] node: add comment for refactoring plan --- nested/src/tree/node.rs | 53 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/nested/src/tree/node.rs b/nested/src/tree/node.rs index 4e67186..f4b3ca3 100644 --- a/nested/src/tree/node.rs +++ b/nested/src/tree/node.rs @@ -15,6 +15,57 @@ use { } }; +/* TODO: refactoring proposal + +struct NestedNodeDisplay { + /// display view + pub view: Option< OuterViewPort >, + + /// diagnostics + pub diag: Option< OuterViewPort> >, + + /// depth + pub depth: SingletonBuffer< usize >, +} + +struct NestedNodeEdit { + /// abstract editor + pub editor: SingletonBuffer< + Option< Arc > +>, + + pub spill_buf: VecBuffer< NestedNode >, + + /// commander & navigation + pub cmd: SingletonBuffer< + Option< Arc> > + >, + pub close_char: SingletonBuffer< + Option< char > + >, + + // could be replaced by cmd when TreeNav -CmdObjects are used + pub tree_nav: SingletonBuffer< + Option< Arc> > + >, +} + +pub struct NewNestedNode { + /// context + pub ctx: Arc>, + + /// abstract data view + pub data: Arc>, + + /// viewports for terminal display + pub disp: NestedNodeDisplay, + + /// editor & commander objects + pub edit: NestedNodeEdit +} + +*/ + #[derive(Clone)] pub struct NestedNode { /// context @@ -158,9 +209,7 @@ impl NestedNode { self.get_data_port::(type_str)?.get_view() } - /* TODO - pub fn get_seq_view<'a, T: Clone>(&self, type_str: impl Iterator) -> Option>> { self.get_data_view::>(type_str) .unwrap()