Make versions oldest_selection and newest_selection that don't require snapshots

I thought I needed this but actually didn't, but I still kinda think it's a good change for the public interface of Editor.
This commit is contained in:
Nathan Sobo
2022-02-27 13:02:09 -07:00
parent 19b5de2181
commit 7ef98fb935
6 changed files with 33 additions and 21 deletions
+3 -1
View File
@@ -382,7 +382,9 @@ impl DiagnosticMessage {
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.newest_selection::<usize>(&buffer.read(cx)).head();
let cursor_position = editor
.newest_selection_with_snapshot::<usize>(&buffer.read(cx))
.head();
let new_diagnostic = buffer
.read(cx)
.diagnostics_in_range::<_, usize>(cursor_position..cursor_position)