store buffer and display_map model handles on selections collection

This commit is contained in:
Keith Simmons 2022-05-12 15:55:18 -07:00
parent db0a9114c2
commit de9dc27980
14 changed files with 373 additions and 393 deletions

View file

@ -58,7 +58,7 @@ impl DiagnosticIndicator {
fn update(&mut self, editor: ViewHandle<Editor>, cx: &mut ViewContext<Self>) {
let editor = editor.read(cx);
let buffer = editor.buffer().read(cx);
let cursor_position = editor.selections.newest::<usize>(&buffer.read(cx)).head();
let cursor_position = editor.selections.newest::<usize>(cx).head();
let new_diagnostic = buffer
.read(cx)
.diagnostics_in_range::<_, usize>(cursor_position..cursor_position, false)