pub struct ThemeManager { /* private fields */ }Expand description
Owns the current Helix theme and cached typed role styles.
Implementations§
Source§impl ThemeManager
impl ThemeManager
Sourcepub fn new(loader: ThemeLoader) -> Self
pub fn new(loader: ThemeLoader) -> Self
Create a manager with an empty current theme.
Sourcepub fn with_theme(loader: ThemeLoader, current: Theme) -> Self
pub fn with_theme(loader: ThemeLoader, current: Theme) -> Self
Create a manager from a loader and initial theme.
Sourcepub fn default_search_paths(app_theme_dir: impl Into<PathBuf>) -> Self
pub fn default_search_paths(app_theme_dir: impl Into<PathBuf>) -> Self
Create a manager with app-local themes first, then standard Helix user config themes.
Sourcepub fn load_ref(&mut self, theme_ref: &str) -> Result<(), ThemeError>
pub fn load_ref(&mut self, theme_ref: &str) -> Result<(), ThemeError>
Load a theme name or file path and replace the current theme. Cached typed role styles are refreshed atomically after a successful load.
Sourcepub fn loaded(self, theme_ref: &str) -> Result<Self, ThemeError>
pub fn loaded(self, theme_ref: &str) -> Result<Self, ThemeError>
Load a theme name or file path and return a manager initialized with it.
Sourcepub fn styles(&self) -> &ThemeStyles
pub fn styles(&self) -> &ThemeStyles
Borrow the cached typed role styles for the current theme.
Sourcepub fn style_from_scopes(&self, scopes: &[&str]) -> Style
pub fn style_from_scopes(&self, scopes: &[&str]) -> Style
Raw scope lookup with a list of fallbacks against the current theme.
Trait Implementations§
Source§impl Clone for ThemeManager
impl Clone for ThemeManager
Source§fn clone(&self) -> ThemeManager
fn clone(&self) -> ThemeManager
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ThemeManager
impl RefUnwindSafe for ThemeManager
impl Send for ThemeManager
impl Sync for ThemeManager
impl Unpin for ThemeManager
impl UnsafeUnpin for ThemeManager
impl UnwindSafe for ThemeManager
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
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 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>
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