pub struct SearchContextSize;Expand description
Number of context lines to show above and below each
matched line in :search results. Default 0 (no
context — only matched lines appear, matching the
“1 line per hit, 1 header per file” UX).
Mirrors grep’s -C N convention
([[feedback_convention_first]]): :set search.context_size=3
yields ±3 lines of context per hit, with adjacent
clusters merged when ranges overlap or touch — the
same shape grep / ripgrep / ag produce.
The substrate’s compose_header_rows dedupes consecutive
same-source excerpts to a single header regardless of
context_size, so increasing this widens the windows
under each file’s header rather than adding new headers.
Implementations§
Source§impl SearchContextSize
impl SearchContextSize
Sourcepub fn build_spec() -> Option<i64>
pub fn build_spec() -> Option<i64>
Build the runtime spec for this declaration.
Used by the registry’s self-registration boot
path; not generally called by hand. Direct
construction of Option<T> is the macro’s
internal-only path – consumer code uses
config.get_typed::<#name_ident>() to read
and config.set_typed::<#name_ident>(...) to
write.
Trait Implementations§
Source§impl HasGroup for SearchContextSize
impl HasGroup for SearchContextSize
Source§const GROUP_NAME: &'static str = <lattice_config::Search as ::lattice_config::OptionGroup>::NAME
const GROUP_NAME: &'static str = <lattice_config::Search as ::lattice_config::OptionGroup>::NAME
"editor", "lsp", …). The macro
pulls this from the group = SomeGroup; directive at the
declaration block’s head.Source§impl OptionDecl for SearchContextSize
impl OptionDecl for SearchContextSize
Source§const NAME: &'static str = SearchContextSize
const NAME: &'static str = SearchContextSize
:set <NAME>=…,
TOML keys, completion candidates, :describe-option.
Internal access is type-driven. The macro derives this
from the option’s identifier (with namespace prefix when
declared via mode_options!); manually-typed NAMEs are
not supported for built-in options.Source§const DOC: &'static str = SearchContextSize
const DOC: &'static str = SearchContextSize
:describe-option, the :customize
form’s per-row help, and :apropos results.Source§const CUSTOMIZABLE: bool = true
const CUSTOMIZABLE: bool = true
true (the default) ⇒ option
appears in :set autocomplete + the :customize group
view. false ⇒ plugin / engine-internal state, hidden
from user surfaces. Equivalent of emacs’s defvar vs
defcustom. (See mode-architecture.md §6.5.3.)Source§type Value = i64
type Value = i64
bool, i64, String, plus any
domain enum that impls [OptionType].Source§fn default_value() -> Self::Value
fn default_value() -> Self::Value
const) so non-const-constructible types like String
can be defaults.Auto Trait Implementations§
impl Freeze for SearchContextSize
impl RefUnwindSafe for SearchContextSize
impl Send for SearchContextSize
impl Sync for SearchContextSize
impl Unpin for SearchContextSize
impl UnsafeUnpin for SearchContextSize
impl UnwindSafe for SearchContextSize
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<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