Add Cursor::set_position.
Make it possible to move a cursor to a new position. In the current implementation of Layout and Cursor, this is a trivial operation, but if we switch to a B-tree based function layout, this involves navigating the tree.
This commit is contained in:
@@ -381,6 +381,11 @@ impl<'f> Cursor<'f> {
|
||||
self.pos
|
||||
}
|
||||
|
||||
/// Move the cursor to a new position.
|
||||
pub fn set_position(&mut self, pos: CursorPosition) {
|
||||
self.pos = pos;
|
||||
}
|
||||
|
||||
/// Get the EBB corresponding to the current position.
|
||||
pub fn current_ebb(&self) -> Option<Ebb> {
|
||||
use self::CursorPosition::*;
|
||||
|
||||
Reference in New Issue
Block a user