Accept finished inline transformations only if the user saves manually (#16112)
Closes https://github.com/zed-industries/zed/issues/16042 This commit modifies the behavior of inline transformations to only accept finished transformations when the user manually saves the file. Previously, transformations were automatically accepted on any save event, including autosaves. This was achieved by updating the `Pane` and `Workspace` structs to emit a new `UserSavedItem` event when a manual save occurs, and modifying the `InlineAssistant` to register and handle this new event (instead of `editor::Saved`). Release Notes: - N/A
This commit is contained in:
@@ -436,6 +436,7 @@ pub trait ItemHandle: 'static + Send {
|
||||
|
||||
pub trait WeakItemHandle: Send + Sync {
|
||||
fn id(&self) -> EntityId;
|
||||
fn boxed_clone(&self) -> Box<dyn WeakItemHandle>;
|
||||
fn upgrade(&self) -> Option<Box<dyn ItemHandle>>;
|
||||
}
|
||||
|
||||
@@ -852,6 +853,10 @@ impl<T: Item> WeakItemHandle for WeakView<T> {
|
||||
self.entity_id()
|
||||
}
|
||||
|
||||
fn boxed_clone(&self) -> Box<dyn WeakItemHandle> {
|
||||
Box::new(self.clone())
|
||||
}
|
||||
|
||||
fn upgrade(&self) -> Option<Box<dyn ItemHandle>> {
|
||||
self.upgrade().map(|v| Box::new(v) as Box<dyn ItemHandle>)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user