mirror of
https://github.com/ilyakooo0/helix.git
synced 2025-01-07 15:30:02 +03:00
Only reconfiure highlights when setting theme
This commit is contained in:
parent
42e13bd542
commit
6825e19509
@ -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()
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ impl Editor {
|
||||
.language_configs_iter()
|
||||
.filter(|cfg| cfg.is_highlight_initialized())
|
||||
{
|
||||
config.highlight_config(scopes);
|
||||
config.reconfigure(scopes);
|
||||
}
|
||||
|
||||
self.theme = theme;
|
||||
|
Loading…
Reference in New Issue
Block a user