Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lua/codeium/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down