Project Search: Don't prompt to save edited buffers in project search results if buffers open elsewhere (#31026)
Closes #ISSUE Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
parent
110195cdae
commit
36ae564b61
2 changed files with 11 additions and 11 deletions
|
@ -1055,10 +1055,17 @@ impl ProjectSearchView {
|
|||
|
||||
let is_dirty = self.is_dirty(cx);
|
||||
|
||||
let should_confirm_save = !will_autosave && is_dirty;
|
||||
let skip_save_on_close = self
|
||||
.workspace
|
||||
.read_with(cx, |workspace, cx| {
|
||||
workspace::Pane::skip_save_on_close(&self.results_editor, workspace, cx)
|
||||
})
|
||||
.unwrap_or(false);
|
||||
|
||||
let should_prompt_to_save = !skip_save_on_close && !will_autosave && is_dirty;
|
||||
|
||||
cx.spawn_in(window, async move |this, cx| {
|
||||
let should_search = if should_confirm_save {
|
||||
let should_search = if should_prompt_to_save {
|
||||
let options = &["Save", "Don't Save", "Cancel"];
|
||||
let result_channel = this.update_in(cx, |_, window, cx| {
|
||||
window.prompt(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue