svg_preview.rs

 1use gpui::{App, actions};
 2use workspace::Workspace;
 3
 4pub mod svg_preview_view;
 5
 6pub use zed_actions::preview::svg::{OpenPreview, OpenPreviewToTheSide};
 7
 8actions!(
 9    svg,
10    [
11        /// Opens a following SVG preview that syncs with the editor.
12        OpenFollowingPreview
13    ]
14);
15
16pub fn init(cx: &mut App) {
17    cx.observe_new(|workspace: &mut Workspace, window, cx| {
18        let Some(window) = window else {
19            return;
20        };
21        crate::svg_preview_view::SvgPreviewView::register(workspace, window, cx);
22    })
23    .detach();
24}