Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Make `zed://` links clickable in terminal (#58910)

Victor Skvortsovc46c350b8e02
diff --git a/crates/terminal/src/alacritty/hyperlinks.rs b/crates/terminal/src/alacritty/hyperlinks.rs
index 15acb69d5d6..1dbec598c09 100644
--- a/crates/terminal/src/alacritty/hyperlinks.rs
+++ b/crates/terminal/src/alacritty/hyperlinks.rs
@@ -19,7 +19,7 @@ use util::paths::{PathStyle, UrlExt};
use crate::Range;
-const URL_REGEX: &str = r#"(ipfs:|ipns:|magnet:|mailto:|gemini://|gopher://|https://|http://|news:|file://|git://|ssh:|ftp://)[^\u{0000}-\u{001F}\u{007F}-\u{009F}<>"\s{-}\^⟨⟩`']+"#;
+const URL_REGEX: &str = r#"(ipfs:|ipns:|magnet:|mailto:|gemini://|gopher://|https://|http://|news:|file://|git://|ssh:|ftp://|zed://)[^\u{0000}-\u{001F}\u{007F}-\u{009F}<>"\s{-}\^⟨⟩`']+"#;
const WIDE_CHAR_SPACERS: Flags =
Flags::from_bits(Flags::LEADING_WIDE_CHAR_SPACER.bits() | Flags::WIDE_CHAR_SPACER.bits())
.unwrap();
@@ -518,6 +518,11 @@ mod tests {
],
);
+ re_test(
+ URL_REGEX,
+ "open zed://channel/the-channel and zed://settings/theme now",
+ vec!["zed://channel/the-channel", "zed://settings/theme"],
+ );
}
#[test]