Show placeholder text for pickers

This commit is contained in:
Antonio Scandurra 2022-11-04 10:18:29 +01:00
parent 08b84416d2
commit 0b231e58fd
19 changed files with 76 additions and 40 deletions

View file

@ -1,3 +1,5 @@
use std::sync::Arc;
use editor::{display_map::ToDisplayPoint, Autoscroll, DisplayPoint, Editor};
use gpui::{
actions, elements::*, geometry::vector::Vector2F, AnyViewHandle, Axis, Entity,
@ -31,7 +33,10 @@ pub enum Event {
impl GoToLine {
pub fn new(active_editor: ViewHandle<Editor>, cx: &mut ViewContext<Self>) -> Self {
let line_editor = cx.add_view(|cx| {
Editor::single_line(Some(|theme| theme.picker.input_editor.clone()), cx)
Editor::single_line(
Some(Arc::new(|theme| theme.picker.input_editor.clone())),
cx,
)
});
cx.subscribe(&line_editor, Self::on_line_editor_event)
.detach();