search: Add ToggleRegex for buffer search (#21799)

CharlesChen0823 created

Closes #21790 

IMO, this is lost

Release Notes:

- Add ToggleRegex for buffer search

Change summary

crates/search/src/buffer_search.rs | 5 +++++
1 file changed, 5 insertions(+)

Detailed changes

crates/search/src/buffer_search.rs 🔗

@@ -529,6 +529,11 @@ impl BufferSearchBar {
                 this.toggle_whole_word(action, cx);
             }
         }));
+        registrar.register_handler(ForDeployed(|this, action: &ToggleRegex, cx| {
+            if this.supported_options().regex {
+                this.toggle_regex(action, cx);
+            }
+        }));
         registrar.register_handler(ForDeployed(|this, action: &ToggleSelection, cx| {
             if this.supported_options().selection {
                 this.toggle_selection(action, cx);