aboutsummaryrefslogtreecommitdiff
path: root/helix-core
diff options
context:
space:
mode:
authorwojciechkepka2021-06-19 11:52:28 +0000
committerBlaž Hrastnik2021-06-19 15:07:13 +0000
commit6825e195099de6e4eab64e26a230cf8a9c9521b7 (patch)
tree7424256c18f77eca9c12ec900a8722129c68c84e /helix-core
parent42e13bd5424581ec7ad299319e7f2f98a9832052 (diff)
Only reconfiure highlights when setting theme
Diffstat (limited to 'helix-core')
-rw-r--r--helix-core/src/syntax.rs19
1 files changed, 9 insertions, 10 deletions
diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs
index 78623fd6..81b6d5a0 100644
--- a/helix-core/src/syntax.rs
+++ b/helix-core/src/syntax.rs
@@ -172,19 +172,18 @@ impl LanguageConfiguration {
}
}
- pub fn highlight_config(&self, scopes: &[String]) -> Option<Arc<HighlightConfiguration>> {
- if let Some(config) = self.highlight_config.get() {
- if let Some(config) = config {
- config.configure(scopes);
- }
- config.clone()
- } else {
- self.highlight_config
- .get_or_init(|| self.initialize_highlight(scopes))
- .clone()
+ pub fn reconfigure(&self, scopes: &[String]) {
+ if let Some(Some(config)) = self.highlight_config.get() {
+ config.configure(scopes);
}
}
+ pub fn highlight_config(&self, scopes: &[String]) -> Option<Arc<HighlightConfiguration>> {
+ self.highlight_config
+ .get_or_init(|| self.initialize_highlight(scopes))
+ .clone()
+ }
+
pub fn is_highlight_initialized(&self) -> bool {
self.highlight_config.get().is_some()
}