@repokit/core 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +1 -1
- package/Cargo.toml +1 -1
- package/installation/install.sh +1 -1
- package/internals/themes/theme_registry.rs +23 -0
- package/package.json +1 -1
package/Cargo.lock
CHANGED
package/Cargo.toml
CHANGED
package/installation/install.sh
CHANGED
|
@@ -46,6 +46,9 @@ impl ThemeRegistry {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
pub fn register_user_theme(&mut self, theme: &RepoKitTheme) {
|
|
49
|
+
if self.themes.contains_key(&theme.name) {
|
|
50
|
+
self.on_naming_conflict(&theme.name);
|
|
51
|
+
}
|
|
49
52
|
self.themes
|
|
50
53
|
.insert(theme.name.clone(), Theme::from_configuration(theme));
|
|
51
54
|
}
|
|
@@ -99,4 +102,24 @@ impl ThemeRegistry {
|
|
|
99
102
|
highlightColor: None,
|
|
100
103
|
})
|
|
101
104
|
}
|
|
105
|
+
|
|
106
|
+
fn on_naming_conflict(&self, name: &str) {
|
|
107
|
+
if ThemeRegistry::built_in_color_schemes()
|
|
108
|
+
.1
|
|
109
|
+
.map(|t| t.0)
|
|
110
|
+
.contains(&name)
|
|
111
|
+
{
|
|
112
|
+
println!(
|
|
113
|
+
"{}: I've discovered a theme that conflicts with one of my iternals. Please rename your {} theme",
|
|
114
|
+
self.current_theme().error_prefix("RepoKit"),
|
|
115
|
+
self.current_theme().highlight(name)
|
|
116
|
+
)
|
|
117
|
+
} else {
|
|
118
|
+
println!(
|
|
119
|
+
"{}: I've discovered two themes with the name {}. Please rename one of them",
|
|
120
|
+
self.current_theme().error_prefix("RepoKit"),
|
|
121
|
+
self.current_theme().highlight(name)
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
}
|
|
102
125
|
}
|