Просмотр исходного кода

feat(colors): adding the possibility to change git-repos colors

Martin Fillon 2 лет назад
Родитель
Сommit
17ed77a3ab
1 измененных файлов с 9 добавлено и 4 удалено
  1. 9 4
      src/theme/ui_styles.rs

+ 9 - 4
src/theme/ui_styles.rs

@@ -117,10 +117,10 @@ pub struct Git {
 #[rustfmt::skip]
 #[derive(Clone, Copy, Debug, Default, PartialEq)]
 pub struct GitRepo {
-    pub branch_main: Style,
-    pub branch_other: Style,
-    pub git_clean: Style,
-    pub git_dirty: Style,
+    pub branch_main: Style,  //Gm
+    pub branch_other: Style, //Go
+    pub git_clean: Style,    //Gc
+    pub git_dirty: Style,    //Gd
 }
 
 #[derive(Clone, Copy, Debug, Default, PartialEq)]
@@ -237,6 +237,11 @@ impl UiStyles {
             "gi" => self.git.ignored                    = pair.to_style(),
             "gc" => self.git.conflicted                 = pair.to_style(),
 
+            "Gm" => self.git_repo.branch_main           = pair.to_style(),
+            "Go" => self.git_repo.branch_other          = pair.to_style(),
+            "Gc" => self.git_repo.git_clean             = pair.to_style(),
+            "Gd" => self.git_repo.git_dirty             = pair.to_style(),
+
             "xx" => self.punctuation                    = pair.to_style(),
             "da" => self.date                           = pair.to_style(),
             "in" => self.inode                          = pair.to_style(),