@@ -22,7 +22,7 @@ pub fn diagnostic<'doc>(
23 Box::new(move |line: usize, _selected: bool, out: &mut String| {
23 Box::new(move |line: usize, _selected: bool, out: &mut String| {
24 use helix_core::diagnostic::Severity;
24 use helix_core::diagnostic::Severity;
25− if let Some(diagnostic) = diagnostics.iter().find(|d| d.line == line) {
25+ if let Some(diagnostic) = diagnostics.binary_search_by_key(&line, |d| d.line) {
26 write!(out, "●").unwrap();
26 write!(out, "●").unwrap();
27 return Some(match diagnostic.severity {
27 return Some(match diagnostic.severity {
28 Some(Severity::Error) => error,
28 Some(Severity::Error) => error,