Atm. we're using a 4-param way of describing ranges (see: Array::quote, Array::move_range_to). I find them pretty unintuitive myself. Given that Rust has excellent support for ranges of all kinds, including detailed bounds definitions, we should use them instead.
This ofc makes it kinda harder when it comes to definition of "stickyness", but think that we could map this onto inclusive/exclusive bounds anyway ie.
..3 which means, from start of the collection till the 3 index exclusive means that range should include concurrent inserts that could happen between indexes 2 and 3, but not the index 3 itself.
..=2 (index number 2 inclusive) means that we stick to the 2 instead - any concurrent inserts between 2 and 3 will not be included into this range.
Rich text editors usually don't define left/right cursor associativity anyway.
This has been done for quotations as part of #334. I'll update move_range in the future to reflect that - this is not very important atm as move_range is an experimental feature.
Atm. we're using a 4-param way of describing ranges (see:
Array::quote
,Array::move_range_to
). I find them pretty unintuitive myself. Given that Rust has excellent support for ranges of all kinds, including detailed bounds definitions, we should use them instead.Current API:
array.move_range_to(txn, 1, Assoc::Right, 3, Assoc::Left, 0)
Proposed one:array.move_range_to(txn, 1..3, 0)
This ofc makes it kinda harder when it comes to definition of "stickyness", but think that we could map this onto inclusive/exclusive bounds anyway ie.
..3
which means, from start of the collection till the 3 index exclusive means that range should include concurrent inserts that could happen between indexes 2 and 3, but not the index 3 itself...=2
(index number 2 inclusive) means that we stick to the 2 instead - any concurrent inserts between 2 and 3 will not be included into this range.Rich text editors usually don't define left/right cursor associativity anyway.