From bf56a88b15ef03b9952a8792849c2e94cfa6b851 Mon Sep 17 00:00:00 2001 From: ^x3ro Date: Fri, 23 Jan 2026 21:40:32 +0100 Subject: [PATCH] Add compatibility with "suda" plugin (`lambdalisue/vim-suda`) --- lua/codeium/util.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/codeium/util.lua b/lua/codeium/util.lua index d953a15..f1ea573 100644 --- a/lua/codeium/util.lua +++ b/lua/codeium/util.lua @@ -86,10 +86,18 @@ end function M.get_uri(path) local info = io.get_system_info() + + -- Remove protocol added by plugin `lambdalisue/vim-suda` + path = path:gsub("^suda://", "") + + -- Resolve relative paths (for example when file is opened by plugin `lambdalisue/vim-suda`) + path = vim.fn.fnamemodify(path, ":p:h") + if info.is_windows then path = path:gsub("\\", "/") return "file:///" .. path end + return "file://" .. path end