pub struct FileTreeBuffer {
pub id: BufferId,
pub content: Buffer,
pub cursor: Position,
pub scroll: usize,
}Expand description
One open file-tree buffer. Carries only the rendered rope and
motion state (cursor + scroll). All “where does this buffer
point” data – root, entry list, nerd-fonts toggle – lives in
the App’s BufferLocals map under the
modes::FileTreeRoot / modes::FileTreeEntries /
modes::FileTreeNerdFonts keys.
Fields§
§id: BufferId§content: Buffer§cursor: Position§scroll: usizeImplementations§
Source§impl FileTreeBuffer
impl FileTreeBuffer
Sourcepub fn open(
root: &Path,
nerd_fonts: bool,
) -> Result<(FileTreeBuffer, Vec<FileTreeEntry>), Error>
pub fn open( root: &Path, nerd_fonts: bool, ) -> Result<(FileTreeBuffer, Vec<FileTreeEntry>), Error>
Build a fresh file-tree rooted at root. Returns the
buffer plus the initial entry list – the caller is
responsible for seeding the modes::FileTreeRoot /
modes::FileTreeEntries / modes::FileTreeNerdFonts
buffer-locals from these values.
Sourcepub fn line_count(&self) -> u32
pub fn line_count(&self) -> u32
Entries in the listing. CV.3: content space — this bounds cursor motion, and the empty line ropey reports after the listing’s terminating newline is not an entry.
Sourcepub fn move_cursor(&mut self, dx: i32, dy: i32, viewport: usize)
pub fn move_cursor(&mut self, dx: i32, dy: i32, viewport: usize)
Same shape as HelpBuffer::move_cursor so the active-buffer
routing in App can drive both kinds through the same motion
path.
pub fn jump_cursor_to(&mut self, line: u32, viewport: usize)
pub fn adjust_scroll_to_cursor(&mut self, viewport: usize)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FileTreeBuffer
impl RefUnwindSafe for FileTreeBuffer
impl Send for FileTreeBuffer
impl Sync for FileTreeBuffer
impl Unpin for FileTreeBuffer
impl UnsafeUnpin for FileTreeBuffer
impl UnwindSafe for FileTreeBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more