editor: Add access method for project
(#36266)
This resolves a `TODO` that I've stumbled upon too many times whilst looking at the editor code. Release Notes: - N/A
This commit is contained in:
parent
bd1fda6782
commit
3c5d5a1d57
11 changed files with 42 additions and 45 deletions
|
@ -299,7 +299,7 @@ pub fn register(editor: &mut Editor, cx: &mut Context<Vim>) {
|
|||
|
||||
Vim::action(editor, cx, |vim, action: &VimSave, window, cx| {
|
||||
vim.update_editor(cx, |_, editor, cx| {
|
||||
let Some(project) = editor.project.clone() else {
|
||||
let Some(project) = editor.project().cloned() else {
|
||||
return;
|
||||
};
|
||||
let Some(worktree) = project.read(cx).visible_worktrees(cx).next() else {
|
||||
|
@ -436,7 +436,7 @@ pub fn register(editor: &mut Editor, cx: &mut Context<Vim>) {
|
|||
let Some(workspace) = vim.workspace(window) else {
|
||||
return;
|
||||
};
|
||||
let Some(project) = editor.project.clone() else {
|
||||
let Some(project) = editor.project().cloned() else {
|
||||
return;
|
||||
};
|
||||
let Some(worktree) = project.read(cx).visible_worktrees(cx).next() else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue