pub struct HelpBuffer {
pub id: BufferId,
pub title: String,
pub content: Buffer,
pub scroll: usize,
pub cursor: Position,
}Expand description
One open help buffer. The content is a real Buffer (rope-
backed), so it composes with everything else that consumes
Buffer – search, motions, syntax highlighting (once a help
major mode + tree-sitter grammar lands).
M.3.2.c.5: per-buffer help metadata (links, anchors,
highlights) lives on the adjacent HelpMetadata – the
App seeds it into buffer_locals[id] at popup-open time so
help-mode-owned per-buffer state has a single source of
truth. HelpBuffer is now the slim viewport + cursor state;
the metadata travels alongside it inside HelpContent.
Fields§
§id: BufferIdStable id assigned at creation. Position-history entries
(§5.1.1) carry this so <C-o> / <C-i> can route back to
the originating buffer when multiple Help buffers coexist
(Phase B.1.c). v1 only ever holds one Help buffer at a
time – the id still matters because the position history
outlives any one Help session and a stale entry must not
land on a freshly-opened, unrelated Help.
title: String§content: Buffer§scroll: usizeFirst visible line index (the popup renderer uses this; a future split/tab/window renderer would use the buffer’s own scroll state instead).
cursor: PositionCursor position inside the help content. The help overlay
behaves like any other buffer – motions move this cursor
and scroll auto-adjusts to keep it in view. The terminal
cursor is rendered at the screen translation of this
position.
Implementations§
Source§impl HelpBuffer
impl HelpBuffer
Sourcepub fn line_count(&self) -> u32
pub fn line_count(&self) -> u32
Number of visible content lines (the popup renderer uses this to clamp scroll). CV.3: content space, as the name already promised — it was reading ropey’s raw count, which let the scroll clamp reach one row past the last help line.
Trait Implementations§
Source§impl Clone for HelpBuffer
impl Clone for HelpBuffer
Source§fn clone(&self) -> HelpBuffer
fn clone(&self) -> HelpBuffer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for HelpBuffer
impl RefUnwindSafe for HelpBuffer
impl Send for HelpBuffer
impl Sync for HelpBuffer
impl Unpin for HelpBuffer
impl UnsafeUnpin for HelpBuffer
impl UnwindSafe for HelpBuffer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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