Skip to main content

SearchContextSize

Struct SearchContextSize 

Source
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

Source

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

Source§

const GROUP_NAME: &'static str = <lattice_config::Search as ::lattice_config::OptionGroup>::NAME

Group display name ("editor", "lsp", …). The macro pulls this from the group = SomeGroup; directive at the declaration block’s head.
Source§

impl OptionDecl for SearchContextSize

Source§

const NAME: &'static str = SearchContextSize

Public display name. Boundary-facing only – :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

Doc string. Shown in :describe-option, the :customize form’s per-row help, and :apropos results.
Source§

const CUSTOMIZABLE: bool = true

Customize-visibility flag. 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

The runtime value type. bool, i64, String, plus any domain enum that impls [OptionType].
Source§

fn default_value() -> Self::Value

Default value. Returned by a function (rather than a const) so non-const-constructible types like String can be defaults.
§

fn type_id() -> TypeId
where Self: Sized,

TypeId of the declaration type itself. Hot-path key for the registry’s type-driven storage. Default impl works for every concrete impl.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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