Skip to content

Commit

Permalink
Allow [ and ] symbols in terminal links (#2899)
Browse files Browse the repository at this point in the history
Deals with https://github.com/zed-industries/community/issues/1865

` ./src/pages/[[...slug]].tsx` is a valid file path in macOs and Linux,
and should be available for cmd-hover-click in terminal.

Release Notes:

- Allow `[` and `]` symbols in terminal links
  • Loading branch information
SomeoneToIgnore authored Aug 28, 2023
2 parents 3bfe78b + 506ec01 commit 81a5043
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/terminal/src/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ lazy_static! {
// * use more strict regex for `file://` protocol matching: original regex has `file:` inside, but we want to avoid matching `some::file::module` strings.
static ref URL_REGEX: RegexSearch = RegexSearch::new(r#"(ipfs:|ipns:|magnet:|mailto:|gemini://|gopher://|https://|http://|news:|file://|git://|ssh:|ftp://)[^\u{0000}-\u{001F}\u{007F}-\u{009F}<>"\s{-}\^⟨⟩`]+"#).unwrap();

static ref WORD_REGEX: RegexSearch = RegexSearch::new(r#"[\w.:/@\-~]+"#).unwrap();
static ref WORD_REGEX: RegexSearch = RegexSearch::new(r#"[\w.\[\]:/@\-~]+"#).unwrap();
}

///Upward flowing events, for changing the title and such
Expand Down

0 comments on commit 81a5043

Please sign in to comment.