From 6931813a397abdf4c84d6852cf03b311a220199c Mon Sep 17 00:00:00 2001
From: Michael Sippel <micha@fragmental.art>
Date: Sun, 27 Oct 2024 13:35:31 +0100
Subject: [PATCH] wip: cursor gravity mode

---
 lib-nested-core/src/edit_tree/cursor.rs    | 8 ++++++++
 lib-nested-core/src/editors/list/editor.rs | 3 +--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib-nested-core/src/edit_tree/cursor.rs b/lib-nested-core/src/edit_tree/cursor.rs
index 9caa659..24e77d2 100644
--- a/lib-nested-core/src/edit_tree/cursor.rs
+++ b/lib-nested-core/src/edit_tree/cursor.rs
@@ -4,6 +4,14 @@ use {
 
 //<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>
 
+enum GravityMode {
+    // tries to maintain a set distance from bottom
+    Gravity(usize),
+
+    // keeps equal distance from root
+    Floating
+}
+
 #[derive(Clone, Eq, PartialEq, Debug)]
 pub struct TreeCursor {
     pub leaf_mode: ListCursorMode,
diff --git a/lib-nested-core/src/editors/list/editor.rs b/lib-nested-core/src/editors/list/editor.rs
index 6773891..80b73d0 100644
--- a/lib-nested-core/src/editors/list/editor.rs
+++ b/lib-nested-core/src/editors/list/editor.rs
@@ -17,14 +17,13 @@ use {
 
 pub struct ListEditor {
     pub cursor: SingletonBuffer<ListCursor>,
-
-    // todo: (?) remove RwLock<..> around NestedNode ??
     pub data: VecBuffer< Arc<RwLock<EditTree>> >,
 
     pub spillbuf: Arc<RwLock<Vec<Arc<RwLock<EditTree>>>>>,
 
     pub(super) addr_port: OuterViewPort<dyn SequenceView<Item = isize>>,
     pub(super) mode_port: OuterViewPort<dyn SingletonView<Item = ListCursorMode>>,
+//  pub(super) grav_port: OuterViewPort<dyn SingletonView<Item = isize>>,
 
     depth: OuterViewPort<dyn SingletonView<Item = usize>>,