pub struct BracketConfig { /* private fields */ }Expand description
Per-language bracket configuration.
Declares which bracket pairs are used for rainbow coloring, auto-pair insertion, and matched-pair highlighting.
Language modules register this during init(). The pair module
reads it at runtime for the current buffer’s language.
Implementations§
Source§impl BracketConfig
impl BracketConfig
Sourcepub fn new(language_id: impl Into<Arc<str>>) -> Self
pub fn new(language_id: impl Into<Arc<str>>) -> Self
Create a new bracket config for a language.
Sourcepub fn with_rainbow(self, pairs: impl IntoIterator<Item = (char, char)>) -> Self
pub fn with_rainbow(self, pairs: impl IntoIterator<Item = (char, char)>) -> Self
Set pairs used for rainbow depth coloring.
Sourcepub fn with_autopair(
self,
pairs: impl IntoIterator<Item = (char, char)>,
) -> Self
pub fn with_autopair( self, pairs: impl IntoIterator<Item = (char, char)>, ) -> Self
Set pairs used for auto-pair insertion.
Sourcepub fn with_highlight(
self,
pairs: impl IntoIterator<Item = (char, char)>,
) -> Self
pub fn with_highlight( self, pairs: impl IntoIterator<Item = (char, char)>, ) -> Self
Set pairs used for matched-pair highlighting.
Sourcepub fn language_id(&self) -> &str
pub fn language_id(&self) -> &str
Get the language ID.
Sourcepub fn rainbow_pairs(&self) -> &[BracketPair]
pub fn rainbow_pairs(&self) -> &[BracketPair]
Get pairs for rainbow coloring.
Sourcepub fn autopair_pairs(&self) -> &[BracketPair]
pub fn autopair_pairs(&self) -> &[BracketPair]
Get pairs for auto-pair insertion.
Sourcepub fn highlight_pairs(&self) -> &[BracketPair]
pub fn highlight_pairs(&self) -> &[BracketPair]
Get pairs for matched-pair highlighting.
Trait Implementations§
Source§impl Clone for BracketConfig
impl Clone for BracketConfig
Source§fn clone(&self) -> BracketConfig
fn clone(&self) -> BracketConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BracketConfig
impl RefUnwindSafe for BracketConfig
impl Send for BracketConfig
impl Sync for BracketConfig
impl Unpin for BracketConfig
impl UnsafeUnpin for BracketConfig
impl UnwindSafe for BracketConfig
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
Mutably borrows from an owned value. Read more