diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 6a8a9be5e..d6ec76100 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -436,7 +436,7 @@ impl Syntax { }; syntax - .update(source, source, &ChangeSet::new(&source)) + .update(source, source, &ChangeSet::new(source)) .unwrap(); syntax @@ -735,9 +735,7 @@ impl Syntax { .peekable(); // If there's no captures, skip the layer - if captures.peek().is_none() { - return None; - } + captures.peek()?; Some(HighlightIterLayer { highlight_end_stack: Vec::new(), diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index 0b5cfd22c..413da7b26 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -594,11 +594,7 @@ impl Document { /// Set the programming language for the file if you know the name (scope) but don't have the /// [`syntax::LanguageConfiguration`] for it. - pub fn set_language2( - &mut self, - scope: &str, - config_loader: Arc, - ) { + pub fn set_language2(&mut self, scope: &str, config_loader: Arc) { let language_config = config_loader.language_config_for_scope(scope); self.set_language(language_config, Some(config_loader)); diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index caf2bce74..5f71fd46c 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -456,11 +456,7 @@ impl Editor { let id = if let Some(id) = id { id } else { - let mut doc = Document::open( - &path, - None, - Some(self.syn_loader.clone()), - )?; + let mut doc = Document::open(&path, None, Some(self.syn_loader.clone()))?; let _ = Self::launch_language_server(&mut self.language_servers, &mut doc);