Fix vim repeat (.) and macro playback insertions in diagnostics and assistant (#22210)

Release Notes:

- Fixed vim repeat (`.`) and macro playback of insertions in diagnostics
and assistant.

Co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
Michael Sloan 2024-12-18 15:30:52 -07:00 committed by GitHub
parent f7a7866d4a
commit 6bb21b1e5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -134,7 +134,11 @@ impl Replayer {
let Ok(workspace) = handle.downcast::<Workspace>() else {
return;
};
let Some(editor) = workspace.read(cx).active_item_as::<Editor>(cx) else {
let Some(editor) = workspace
.read(cx)
.active_item(cx)
.and_then(|item| item.act_as::<Editor>(cx))
else {
return;
};
editor.update(cx, |editor, cx| {