Skip to repository content50 lines · 1.7 KB · rust
tenant.openagents/omega
No repository description is available.
OpenAgents Git authority 2026-07-28T03:37:39.167Z Public web read
NIP-34 coordinate
30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omegaMaintainersHidden in public view
References2 branches · 1 tag
Read-only clone
git clone https://openagents.com/git/tenant.openagents/omega.gitBrowse files
markdown_preview.rs
1use gpui::{App, actions};
2use workspace::Workspace;
3
4pub mod markdown_preview_settings;
5pub mod markdown_preview_view;
6
7pub use zed_actions::preview::markdown::{OpenPreview, OpenPreviewToTheSide};
8
9use crate::markdown_preview_view::MarkdownPreviewView;
10
11actions!(
12 markdown,
13 [
14 /// Scrolls up by one page in the markdown preview.
15 #[action(deprecated_aliases = ["markdown::MovePageUp"])]
16 ScrollPageUp,
17 /// Scrolls down by one page in the markdown preview.
18 #[action(deprecated_aliases = ["markdown::MovePageDown"])]
19 ScrollPageDown,
20 /// Scrolls up by approximately one visual line.
21 ScrollUp,
22 /// Scrolls down by approximately one visual line.
23 ScrollDown,
24 /// Scrolls up by one markdown element in the markdown preview
25 ScrollUpByItem,
26 /// Scrolls down by one markdown element in the markdown preview
27 ScrollDownByItem,
28 /// Scrolls to the top of the markdown preview.
29 ScrollToTop,
30 /// Scrolls to the bottom of the markdown preview.
31 ScrollToBottom,
32 /// Opens a following markdown preview that syncs with the editor.
33 OpenFollowingPreview,
34 /// Closes the markdown preview and returns focus to the source editor.
35 CloseAndReturnToEditor
36 ]
37);
38
39pub fn init(cx: &mut App) {
40 workspace::register_serializable_item::<MarkdownPreviewView>(cx);
41
42 cx.observe_new(|workspace: &mut Workspace, window, cx| {
43 let Some(window) = window else {
44 return;
45 };
46 markdown_preview_view::MarkdownPreviewView::register(workspace, window, cx);
47 })
48 .detach();
49}
50