Refactor retrieving oldest and newest selection
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
0a6293bcda
commit
401b59be5c
4 changed files with 149 additions and 30 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue