Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Song-Nop committed Dec 13, 2024
1 parent 3e82701 commit 16c4c5b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
14 changes: 9 additions & 5 deletions crates/typst-preview/src/actor/typst.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,15 @@ impl<T: SourceFileServer + EditorServer> TypstActor<T> {
if let Some(info) = res {
let _ = self
.webview_conn_sender
.send(WebviewActorRequest::SrcToDocJump(info.into_iter().map(|info| DocumentPosition {
page_no: info.page.into(),
x: info.point.x.to_pt() as f32,
y: info.point.y.to_pt() as f32,
}).collect()));
.send(WebviewActorRequest::SrcToDocJump(
info.into_iter()
.map(|info| DocumentPosition {
page_no: info.page.into(),
x: info.point.x.to_pt() as f32,
y: info.point.y.to_pt() as f32,
})
.collect(),
));
}
}
TypstActorRequest::SyncMemoryFiles(m) => {
Expand Down
5 changes: 1 addition & 4 deletions crates/typst-preview/src/actor/webview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ fn position_req(
format!("{event},{page_no} {x} {y}")
}

fn positions_req(
event: &'static str,
positions: Vec<DocumentPosition>,
) -> String {
fn positions_req(event: &'static str, positions: Vec<DocumentPosition>) -> String {
format!("{event},")
+ &positions
.iter()
Expand Down

0 comments on commit 16c4c5b

Please sign in to comment.