Focus in-progress rename editor when editor is focused

This commit is contained in:
Nathan Sobo 2022-03-10 16:42:20 -07:00
parent a498cd32c8
commit 94bf3366f6

View file

@ -5607,6 +5607,9 @@ impl View for Editor {
}
fn on_focus(&mut self, cx: &mut ViewContext<Self>) {
if let Some(rename) = self.pending_rename.as_ref() {
cx.focus(&rename.editor);
} else {
self.focused = true;
self.blink_cursors(self.blink_epoch, cx);
self.buffer.update(cx, |buffer, cx| {
@ -5614,6 +5617,7 @@ impl View for Editor {
buffer.set_active_selections(&self.selections, cx)
});
}
}
fn on_blur(&mut self, cx: &mut ViewContext<Self>) {
self.focused = false;