aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/editor.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2022-01-03 03:52:01 +0000
committerBlaž Hrastnik2022-01-23 07:00:24 +0000
commit53d881f17229e1fcda4f1e139258059b85e6beeb (patch)
tree5db8ed959e6d4ebaf9e97b8cd1d696ec73453aae /helix-view/src/editor.rs
parent6728e4449038e9481b72251441182d508c165a9c (diff)
Store theme scopes on the loader, this way theme isn't passed around
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r--helix-view/src/editor.rs11
1 files changed, 2 insertions, 9 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 9ad1558b..caf2bce7 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -268,13 +268,7 @@ impl Editor {
}
let scopes = theme.scopes();
- for config in self
- .syn_loader
- .language_configs_iter()
- .filter(|cfg| cfg.is_highlight_initialized())
- {
- config.reconfigure(scopes);
- }
+ self.syn_loader.set_scopes(scopes.to_vec());
self.theme = theme;
self._refresh();
@@ -283,7 +277,7 @@ impl Editor {
/// Refreshes the language server for a given document
pub fn refresh_language_server(&mut self, doc_id: DocumentId) -> Option<()> {
let doc = self.documents.get_mut(&doc_id)?;
- doc.detect_language(Some(&self.theme), self.syn_loader.clone());
+ doc.detect_language(self.syn_loader.clone());
Self::launch_language_server(&mut self.language_servers, doc)
}
@@ -465,7 +459,6 @@ impl Editor {
let mut doc = Document::open(
&path,
None,
- Some(&self.theme),
Some(self.syn_loader.clone()),
)?;