Fix project search unsaved edits (#30864)
Closes #30820 Release Notes: - Fixed an issue where entering a new search in the project search would drop unsaved edits in the project search buffer --------- Co-authored-by: Mark Janssen <20283+praseodym@users.noreply.github.com>
This commit is contained in:
parent
4d827924f0
commit
f56960ab5b
3 changed files with 151 additions and 54 deletions
|
@ -564,6 +564,10 @@ pub trait ItemHandle: 'static + Send {
|
|||
fn preserve_preview(&self, cx: &App) -> bool;
|
||||
fn include_in_nav_history(&self) -> bool;
|
||||
fn relay_action(&self, action: Box<dyn Action>, window: &mut Window, cx: &mut App);
|
||||
fn can_autosave(&self, cx: &App) -> bool {
|
||||
let is_deleted = self.project_entry_ids(cx).is_empty();
|
||||
self.is_dirty(cx) && !self.has_conflict(cx) && self.can_save(cx) && !is_deleted
|
||||
}
|
||||
}
|
||||
|
||||
pub trait WeakItemHandle: Send + Sync {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue