From e9160bde423f727036951aba92ddd6dbee674013 Mon Sep 17 00:00:00 2001 From: Phil-Bastian Berndt Date: Thu, 18 Jul 2024 23:01:24 +0200 Subject: [PATCH] Add support for __RELATIVEFILE__ (#166) --- priv/static/phoenix_live_reload.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/priv/static/phoenix_live_reload.js b/priv/static/phoenix_live_reload.js index 01ba070..b999a76 100644 --- a/priv/static/phoenix_live_reload.js +++ b/priv/static/phoenix_live_reload.js @@ -114,7 +114,10 @@ class LiveReloader { this.channel.push("full_path", {rel_path: file, app: app}) .receive("ok", ({full_path}) => { console.log("full path", full_path) - let url = this.editorURL.replace("__FILE__", full_path).replace("__LINE__", line) + let url = this.editorURL + .replace("__RELATIVEFILE__", file) + .replace("__FILE__", full_path) + .replace("__LINE__", line) window.open(url, "_self") }) .receive("error", reason => console.error("failed to resolve full path", reason))