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<(Self, Vec<FileTreeEntry>)>
pub fn open(root: &Path, nerd_fonts: bool) -> Result<(Self, Vec<FileTreeEntry>)>
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.