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