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
|
@ -56,7 +56,7 @@ pub fn new_journal_entry(app_state: Arc<AppState>, cx: &mut MutableAppContext) {
|
|||
if let Some(Some(Ok(item))) = opened.first() {
|
||||
if let Some(editor) = item.downcast::<Editor>() {
|
||||
editor.update(&mut cx, |editor, cx| {
|
||||
let len = editor.buffer().read(cx).read(cx).len();
|
||||
let len = editor.buffer().read(cx).len(cx);
|
||||
editor.change_selections(Some(Autoscroll::Center), cx, |s| {
|
||||
s.select_ranges([len..len])
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue