Allow using context in the placeholder_text method

This commit is contained in:
Kirill Bulatov 2024-02-24 23:26:40 +02:00 committed by Kirill Bulatov
parent cf3b875922
commit c29ea9bdbc
17 changed files with 24 additions and 22 deletions

View file

@ -127,7 +127,9 @@ impl Render for BufferSearchBar {
let supported_options = self.supported_options();
if self.query_editor.read(cx).placeholder_text().is_none() {
if self.query_editor.update(cx, |query_editor, cx| {
query_editor.placeholder_text(cx).is_none()
}) {
let query_focus_handle = self.query_editor.focus_handle(cx);
let up_keystrokes = cx
.bindings_for_action_in(&PreviousHistoryQuery {}, &query_focus_handle)