pub struct MagitHunkSyntaxHighlight;Expand description
Syntax-highlight the code inside a diff, with the + / -
colouring layered over it. On by default.
Turning it off gives the flat per-line colouring magit had before — every added line one green, every removed line one red — and skips the tree-sitter parse each hunk otherwise costs. The parse runs off the actor thread and is bounded by the hunk, not the file, so this is an aesthetic switch rather than a performance one for all but the largest diffs.
Read per refresh, not at buffer open, so :set takes effect on
the next gr rather than only on reopen — the same contract
magit.hunk.context-lines has.
Implementations§
Source§impl MagitHunkSyntaxHighlight
impl MagitHunkSyntaxHighlight
Sourcepub fn build_spec() -> Option<bool>
pub fn build_spec() -> Option<bool>
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 MagitHunkSyntaxHighlight
impl HasGroup for MagitHunkSyntaxHighlight
Source§const GROUP_NAME: &'static str = <lattice_config::Magit as ::lattice_config::OptionGroup>::NAME
const GROUP_NAME: &'static str = <lattice_config::Magit 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 MagitHunkSyntaxHighlight
impl OptionDecl for MagitHunkSyntaxHighlight
Source§const NAME: &'static str = MagitHunkSyntaxHighlight
const NAME: &'static str = MagitHunkSyntaxHighlight
: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 = MagitHunkSyntaxHighlight
const DOC: &'static str = MagitHunkSyntaxHighlight
: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 = bool
type Value = bool
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 MagitHunkSyntaxHighlight
impl RefUnwindSafe for MagitHunkSyntaxHighlight
impl Send for MagitHunkSyntaxHighlight
impl Sync for MagitHunkSyntaxHighlight
impl Unpin for MagitHunkSyntaxHighlight
impl UnsafeUnpin for MagitHunkSyntaxHighlight
impl UnwindSafe for MagitHunkSyntaxHighlight
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