summaryrefslogtreecommitdiff
path: root/helix-view/src/editor.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-11-06 15:21:03 +0000
committerBlaž Hrastnik2022-01-23 07:00:24 +0000
commit6728e4449038e9481b72251441182d508c165a9c (patch)
tree2967675e350be4b6daf815a6662a644b76239882 /helix-view/src/editor.rs
parent83bde1004d596740a7bb63ec7fe2271734492f59 (diff)
syntax: Split parsing and highlighting
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r--helix-view/src/editor.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 7406b475..9ad1558b 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -283,7 +283,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);
+ doc.detect_language(Some(&self.theme), self.syn_loader.clone());
Self::launch_language_server(&mut self.language_servers, doc)
}
@@ -462,7 +462,12 @@ impl Editor {
let id = if let Some(id) = id {
id
} else {
- let mut doc = Document::open(&path, None, Some(&self.theme), Some(&self.syn_loader))?;
+ let mut doc = Document::open(
+ &path,
+ None,
+ Some(&self.theme),
+ Some(self.syn_loader.clone()),
+ )?;
let _ = Self::launch_language_server(&mut self.language_servers, &mut doc);