Refactor retrieving oldest and newest selection
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
co-authored by
Nathan Sobo
parent
0a6293bcda
commit
401b59be5c
@@ -258,11 +258,7 @@ impl DiagnosticMessage {
|
||||
|
||||
fn update(&mut self, editor: ViewHandle<Editor>, cx: &mut ViewContext<Self>) {
|
||||
let editor = editor.read(cx);
|
||||
let cursor_position = editor
|
||||
.selections::<usize>(cx)
|
||||
.max_by_key(|selection| selection.id)
|
||||
.unwrap()
|
||||
.head();
|
||||
let cursor_position = editor.newest_selection(cx).head();
|
||||
let new_diagnostic = editor
|
||||
.buffer()
|
||||
.read(cx)
|
||||
|
||||
Reference in New Issue
Block a user