ui: Since diagnostics are sorted, we can use binary search
This commit is contained in:
parent
b55ca8fdb8
commit
28fd704bce
1 changed files with 2 additions and 1 deletions
|
@ -482,7 +482,8 @@ impl EditorView {
|
||||||
|
|
||||||
for (i, line) in (view.offset.row..(last_line + 1)).enumerate() {
|
for (i, line) in (view.offset.row..(last_line + 1)).enumerate() {
|
||||||
use helix_core::diagnostic::Severity;
|
use helix_core::diagnostic::Severity;
|
||||||
if let Some(diagnostic) = doc.diagnostics().iter().find(|d| d.line == line) {
|
if let Ok(diagnostic) = doc.diagnostics().binary_search_by_key(&line, |d| d.line) {
|
||||||
|
let diagnostic = &doc.diagnostics()[diagnostic];
|
||||||
surface.set_stringn(
|
surface.set_stringn(
|
||||||
viewport.x,
|
viewport.x,
|
||||||
viewport.y + i as u16,
|
viewport.y + i as u16,
|
||||||
|
|
Loading…
Reference in a new issue