Reduce accessibility of multibuffer read to reduce risk of borrowing snapshot and buffer refcells twice
This commit is contained in:
parent
2f7eb6dbc5
commit
a2fd41174f
9 changed files with 36 additions and 17 deletions
|
@ -60,7 +60,7 @@ impl DiagnosticIndicator {
|
|||
let buffer = editor.buffer().read(cx);
|
||||
let cursor_position = editor.selections.newest::<usize>(cx).head();
|
||||
let new_diagnostic = buffer
|
||||
.read(cx)
|
||||
.snapshot(cx)
|
||||
.diagnostics_in_range::<_, usize>(cursor_position..cursor_position, false)
|
||||
.filter(|entry| !entry.range.is_empty())
|
||||
.min_by_key(|entry| (entry.diagnostic.severity, entry.range.len()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue