Align project panel and git panel deletion behavior (#27525)
This change makes the git panel and project panel behave the same, on Linux and macOS, and adds prompts. Release Notes: - Changed the git panel to prompt before restoring a file.
This commit is contained in:
parent
999ad77a59
commit
9e02fee98d
5 changed files with 93 additions and 10 deletions
|
@ -375,16 +375,50 @@ macro_rules! action_with_deprecated_aliases {
|
|||
$name,
|
||||
$name,
|
||||
fn build(
|
||||
_: gpui::private::serde_json::Value,
|
||||
value: gpui::private::serde_json::Value,
|
||||
) -> gpui::Result<::std::boxed::Box<dyn gpui::Action>> {
|
||||
Ok(Box::new(Self))
|
||||
},
|
||||
|
||||
fn action_json_schema(
|
||||
generator: &mut gpui::private::schemars::gen::SchemaGenerator,
|
||||
) -> Option<gpui::private::schemars::schema::Schema> {
|
||||
None
|
||||
|
||||
},
|
||||
|
||||
fn deprecated_aliases() -> &'static [&'static str] {
|
||||
&[
|
||||
$($alias),*
|
||||
]
|
||||
}
|
||||
);
|
||||
|
||||
gpui::register_action!($name);
|
||||
};
|
||||
}
|
||||
|
||||
/// Defines and registers a unit struct that can be used as an action, with some deprecated aliases.
|
||||
#[macro_export]
|
||||
macro_rules! impl_action_with_deprecated_aliases {
|
||||
($namespace:path, $name:ident, [$($alias:literal),* $(,)?]) => {
|
||||
gpui::__impl_action!(
|
||||
$namespace,
|
||||
$name,
|
||||
$name,
|
||||
fn build(
|
||||
value: gpui::private::serde_json::Value,
|
||||
) -> gpui::Result<::std::boxed::Box<dyn gpui::Action>> {
|
||||
Ok(std::boxed::Box::new(gpui::private::serde_json::from_value::<Self>(value)?))
|
||||
},
|
||||
|
||||
fn action_json_schema(
|
||||
generator: &mut gpui::private::schemars::gen::SchemaGenerator,
|
||||
) -> Option<gpui::private::schemars::schema::Schema> {
|
||||
Some(<Self as gpui::private::schemars::JsonSchema>::json_schema(
|
||||
generator,
|
||||
))
|
||||
},
|
||||
|
||||
fn deprecated_aliases() -> &'static [&'static str] {
|
||||
&[
|
||||
$($alias),*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue