Skip to main content

FileTreeBuffer

Struct FileTreeBuffer 

Source
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: usize

Implementations§

Source§

impl FileTreeBuffer

Source

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.

Source

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.

Source

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.

Source

pub fn jump_cursor_to(&mut self, line: u32, viewport: usize)

Source

pub fn adjust_scroll_to_cursor(&mut self, viewport: usize)

Trait Implementations§

Source§

impl Debug for FileTreeBuffer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more