Do not allow drag and drop of FS entries into the remote projects (#19565)

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2024-10-22 22:34:54 +03:00 committed by GitHub
parent 23ad470daf
commit 7a6550c1d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 87 additions and 71 deletions

View file

@ -89,6 +89,7 @@ impl TerminalPanel {
pane.display_nav_history_buttons(None);
pane.set_should_display_tab_bar(|_| true);
let is_local = workspace.project().read(cx).is_local();
let workspace = workspace.weak_handle();
pane.set_custom_drop_handle(cx, move |pane, dropped_item, cx| {
if let Some(tab) = dropped_item.downcast_ref::<DraggedTab>() {
@ -128,8 +129,10 @@ impl TerminalPanel {
{
add_paths_to_terminal(pane, &[entry_path], cx);
}
} else if let Some(paths) = dropped_item.downcast_ref::<ExternalPaths>() {
add_paths_to_terminal(pane, paths.paths(), cx);
} else if is_local {
if let Some(paths) = dropped_item.downcast_ref::<ExternalPaths>() {
add_paths_to_terminal(pane, paths.paths(), cx);
}
}
ControlFlow::Break(())