From 27db43978783f93d7c1b1ed484c8f596220f6e51 Mon Sep 17 00:00:00 2001 From: spore Date: Fri, 23 May 2025 23:41:31 +0800 Subject: [PATCH] fix: recognize url schemes and treat them as absolute paths --- lua/flatten/core.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/flatten/core.lua b/lua/flatten/core.lua index 5ff3b85..9f4d0a4 100644 --- a/lua/flatten/core.lua +++ b/lua/flatten/core.lua @@ -1,7 +1,9 @@ local M = {} local function path_is_absolute(path) - path = string.gsub(path, "^%s+://", "") + if string.find(path, "^%a[%w.+-]*://") then + return true + end if jit.os == "Windows" then return string.find(path, "^%a:") ~= nil