Fixes for M-02 to M-14, G-01 to G-14, K-02 to K-04, X-04 to X-14, not yet reviewed
Committed before review so Windows and WSL builds can start. Each fix was tested and mutation-checked here; the codex review of each item is still to come, so tasks/BUGS.md stays unticked. M-02 is mid-review: round 1 findings are fixed (apps/ely-mark/src/tally.rs). K-01 stays deferred. The ElyMark window test mark-outside.sh failed once at its crash-recovery step in the last run; not yet looked into.
This commit is contained in:
75 files changed
+1482
-354
No files matched your search
@@ -5,17 +5,12 @@ use gpui::Context;
|
||||
|
||||
use crate::view::{Failed, PdfView};
|
||||
|
||||
/// Addresses that may leave the document.
|
||||
pub fn outward(uri: &str) -> bool {
|
||||
["https://", "http://", "mailto:"].iter().any(|scheme| uri.starts_with(scheme))
|
||||
}
|
||||
|
||||
/// A target as typed: a page number or an address.
|
||||
pub fn parse(typed: &str, pages: usize) -> Option<Target> {
|
||||
let typed = typed.trim();
|
||||
match typed.parse::<usize>() {
|
||||
Ok(n) => (1..=pages).contains(&n).then(|| Target::Page(n - 1, 0.0)),
|
||||
Err(_) => outward(typed).then(|| Target::Web(typed.to_string())),
|
||||
Err(_) => ely_office::outward(typed).then(|| Target::Web(typed.to_string())),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,12 +30,12 @@ impl PdfView {
|
||||
log::info!("pdf: follows a link to page {}", page + 1);
|
||||
self.show(page, link.y, cx)
|
||||
}
|
||||
None if outward(&link.uri) => {
|
||||
None if ely_office::outward(&link.uri) => {
|
||||
log::info!("pdf: opens a link outside");
|
||||
cx.open_url(&link.uri)
|
||||
}
|
||||
None => {
|
||||
let text = crate::viewer::Viewer::text(cx, "pdf.link.refused", &[]);
|
||||
let text = crate::viewer::Viewer::text(cx, "office.link.refused", &[]);
|
||||
cx.emit(Failed(text.to_string()))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user