Avoid cancelling ::open_entry task in FileFinder
This commit is contained in:
@@ -275,7 +275,9 @@ impl FileFinder {
|
||||
) {
|
||||
match event {
|
||||
Event::Selected(tree_id, path) => {
|
||||
workspace_view.open_entry((*tree_id, path.clone()), ctx);
|
||||
workspace_view
|
||||
.open_entry((*tree_id, path.clone()), ctx)
|
||||
.map(|d| d.detach());
|
||||
workspace_view.dismiss_modal(ctx);
|
||||
}
|
||||
Event::Dismissed => {
|
||||
|
||||
@@ -3,7 +3,8 @@ use crate::{settings::Settings, watch};
|
||||
use futures_core::{future::LocalBoxFuture, Future};
|
||||
use gpui::{
|
||||
color::rgbu, elements::*, json::to_string_pretty, keymap::Binding, AnyViewHandle, AppContext,
|
||||
ClipboardItem, Entity, ModelHandle, MutableAppContext, View, ViewContext, ViewHandle,
|
||||
ClipboardItem, Entity, EntityTask, ModelHandle, MutableAppContext, View, ViewContext,
|
||||
ViewHandle,
|
||||
};
|
||||
use log::error;
|
||||
use std::{
|
||||
@@ -223,11 +224,12 @@ impl WorkspaceView {
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn open_entry(
|
||||
&mut self,
|
||||
entry: (usize, Arc<Path>),
|
||||
ctx: &mut ViewContext<Self>,
|
||||
) -> Option<impl Future<Output = ()>> {
|
||||
) -> Option<EntityTask<()>> {
|
||||
if self.loading_entries.contains(&entry) {
|
||||
return None;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user