Disable auto-close in search (#35005)

Currently if you type `\(`, it auto-closes to `\()` which is broken.

It's arguably nice that if you type `(` it auto-closes to `()`, but I am
much more likely to be looking for a function call `name\(` than to be
starting a group in search.

Release Notes:

- search: Regex search will no longer try to close parenthesis
automatically.
This commit is contained in:
Conrad Irwin 2025-07-23 23:45:01 -06:00 committed by GitHub
parent a6956eebcb
commit 34bf6ebba6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -700,7 +700,11 @@ impl BufferSearchBar {
window: &mut Window,
cx: &mut Context<Self>,
) -> Self {
let query_editor = cx.new(|cx| Editor::single_line(window, cx));
let query_editor = cx.new(|cx| {
let mut editor = Editor::single_line(window, cx);
editor.set_use_autoclose(false);
editor
});
cx.subscribe_in(&query_editor, window, Self::on_query_editor_event)
.detach();
let replacement_editor = cx.new(|cx| Editor::single_line(window, cx));