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
|
@ -84,7 +84,7 @@ impl OutlineView {
|
|||
.read(cx)
|
||||
.buffer()
|
||||
.read(cx)
|
||||
.read(cx)
|
||||
.snapshot(cx)
|
||||
.outline(Some(cx.global::<Settings>().theme.editor.syntax.as_ref()));
|
||||
if let Some(outline) = buffer {
|
||||
workspace.toggle_modal(cx, |_, cx| {
|
||||
|
@ -171,8 +171,8 @@ impl PickerDelegate for OutlineView {
|
|||
.collect();
|
||||
|
||||
let editor = self.active_editor.read(cx);
|
||||
let buffer = editor.buffer().read(cx).read(cx);
|
||||
let cursor_offset = editor.selections.newest::<usize>(cx).head();
|
||||
let buffer = editor.buffer().read(cx).snapshot(cx);
|
||||
selected_index = self
|
||||
.outline
|
||||
.items
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue