From 7baa348d476af177669610bdb997b1df98f35629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Dzivjak?= Date: Sat, 4 Feb 2023 10:07:39 +0000 Subject: [PATCH] feat(commands): open urls with goto_file command Add capability for `goto_file` command to open an URL under cursor. Fixes: https://github.com/helix-editor/helix/issues/1472 Superseds: https://github.com/helix-editor/helix/pull/4398 --- Cargo.lock | 1 + helix-core/Cargo.toml | 1 + helix-core/src/lib.rs | 1 + helix-view/src/document.rs | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 544a13bb633c1..da51e85ba6cc5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1140,6 +1140,7 @@ dependencies = [ "unicode-general-category", "unicode-segmentation", "unicode-width", + "url", ] [[package]] diff --git a/helix-core/Cargo.toml b/helix-core/Cargo.toml index 8035333dd7424..e96e20a737d62 100644 --- a/helix-core/Cargo.toml +++ b/helix-core/Cargo.toml @@ -38,6 +38,7 @@ log = "0.4" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" toml = "0.7" +url = "2.3.1" imara-diff = "0.1.0" diff --git a/helix-core/src/lib.rs b/helix-core/src/lib.rs index 0acdb238054ce..593e75fa30cf0 100644 --- a/helix-core/src/lib.rs +++ b/helix-core/src/lib.rs @@ -1,4 +1,5 @@ pub use encoding_rs as encoding; +pub use url; pub mod auto_pairs; pub mod chars; diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index bb61eaa6aae68..1920786a2aa34 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -634,7 +634,7 @@ where } use helix_lsp::{lsp, Client, LanguageServerName}; -use url::Url; +use helix_core::url::Url; impl Document { pub fn from(