feat: syntax highlighting for diff view
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
mod catppuccin;
|
||||
pub(crate) mod syntax;
|
||||
|
||||
use gpui::Rgba;
|
||||
|
||||
#[allow(unused_imports)]
|
||||
pub use syntax::{HIGHLIGHT_NAMES, ThemeSyntax, ThemeSyntaxHighlight};
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
|
||||
pub enum ThemeMode {
|
||||
Light,
|
||||
@@ -15,6 +19,7 @@ pub struct Theme {
|
||||
pub name: &'static str,
|
||||
pub mode: ThemeMode,
|
||||
pub colors: ThemeColors,
|
||||
pub syntax: ThemeSyntax,
|
||||
}
|
||||
|
||||
impl Default for Theme {
|
||||
@@ -103,7 +108,7 @@ impl ThemeFamily {
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn theme(self, mode: ThemeMode) -> Theme {
|
||||
pub fn theme(self, mode: ThemeMode) -> Theme {
|
||||
self.variant(mode).theme()
|
||||
}
|
||||
|
||||
@@ -144,7 +149,7 @@ impl ThemeVariant {
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn theme(self) -> Theme {
|
||||
pub fn theme(self) -> Theme {
|
||||
match self {
|
||||
| Self::CatppuccinLatte => catppuccin::latte(),
|
||||
| Self::CatppuccinMocha => catppuccin::mocha(),
|
||||
|
||||
Reference in New Issue
Block a user