buffer_search: Fix DeployReplace not working when buffer search is already deployed (#29066)
Closes #29000 When buffer search is already deployed: 1. If find dialog is enabled, change it to find-and-replace dialog and focuses to it 2. If find-and-replace is enabled, focuses to it Release Notes: - Fixed an issue where invoking `DeployReplace` while the Find dialog was open did not switch to the Find & Replace dialog. - Fixed an issue where invoking `DeployReplace` while the Find & Replace dialog was already open did not focus it.
This commit is contained in:
parent
3fe15ee915
commit
65a7076ba8
1 changed files with 10 additions and 3 deletions
|
@ -657,6 +657,16 @@ impl BufferSearchBar {
|
||||||
registrar.register_handler(ForDeployed(|this, deploy, window, cx| {
|
registrar.register_handler(ForDeployed(|this, deploy, window, cx| {
|
||||||
this.deploy(deploy, window, cx);
|
this.deploy(deploy, window, cx);
|
||||||
}));
|
}));
|
||||||
|
registrar.register_handler(ForDismissed(|this, deploy, window, cx| {
|
||||||
|
this.deploy(deploy, window, cx);
|
||||||
|
}));
|
||||||
|
registrar.register_handler(ForDeployed(|this, _: &DeployReplace, window, cx| {
|
||||||
|
if this.supported_options(cx).find_in_results {
|
||||||
|
cx.propagate();
|
||||||
|
} else {
|
||||||
|
this.deploy(&Deploy::replace(), window, cx);
|
||||||
|
}
|
||||||
|
}));
|
||||||
registrar.register_handler(ForDismissed(|this, _: &DeployReplace, window, cx| {
|
registrar.register_handler(ForDismissed(|this, _: &DeployReplace, window, cx| {
|
||||||
if this.supported_options(cx).find_in_results {
|
if this.supported_options(cx).find_in_results {
|
||||||
cx.propagate();
|
cx.propagate();
|
||||||
|
@ -664,9 +674,6 @@ impl BufferSearchBar {
|
||||||
this.deploy(&Deploy::replace(), window, cx);
|
this.deploy(&Deploy::replace(), window, cx);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
registrar.register_handler(ForDismissed(|this, deploy, window, cx| {
|
|
||||||
this.deploy(deploy, window, cx);
|
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(
|
pub fn new(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue