pub struct ContextOptions {
pub max_lines: u32,
pub trim: TrimScope,
pub multiline_threshold: u32,
pub max_viewport_fraction: u32,
pub viewport_height: u32,
pub viewport_top: u32,
pub reserved_rows: u32,
}Expand description
The knobs resolve_context reads. Mirrors the context.* options
the plugin registers; the host resolves them per buffer and passes
them in, so this stays a pure function.
Fields§
§max_lines: u32Maximum context rows (not scopes — a multi-line header spends
more than one). 0 means unlimited, and is the default.
The principled bound is Self::max_viewport_fraction, not this: a
fraction scales with the pane, so a tall window shows deep nesting and
a short split shows little, which is what a reader wants in both. A row
count cannot do that — tuned for one pane size it is wrong at every
other.
Truncating also loses the WRONG end first. Depth is not noise: the
outermost scope (impl Foo) is the most stable and often the most
valuable line in the strip, and a hard cap of 3 discards it exactly
when nesting is deep enough to need it. So the cap is off by default
and available as a preference for anyone who wants a fixed ceiling.
trim: TrimScopeWhich end to drop when over budget.
multiline_threshold: u32Maximum rows a single scope’s header may contribute.
max_viewport_fraction: u32Percent of the pane height the whole sticky strip may occupy.
viewport_height: u32The pane’s height in rows, for the fraction guard.
viewport_top: u32First source line the pane is showing. A scope whose header is at or below this line is still on screen, so pinning it would spend a row duplicating a visible line — the resolver drops it.
reserved_rows: u32Rows the headerline already occupies. Context stacks under it and never displaces it, so those rows come out of the same viewport budget.
Trait Implementations§
Source§impl Clone for ContextOptions
impl Clone for ContextOptions
Source§fn clone(&self) -> ContextOptions
fn clone(&self) -> ContextOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more