Skip to content

Commit

Permalink
Call vim.uv.realpath on path returned from jj root
Browse files Browse the repository at this point in the history
On windows, jj root may return a UNC path. In these cases plenary Job
does not always succeed at finding the directory and returns an error.
To prevent this we call `vim.uv.realpath` so to canacolize the path so
that it is valid for neovim to use.
  • Loading branch information
zschreur committed Jul 13, 2024
1 parent c070513 commit e65bbc2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/telescope-jj/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ local putils = require("telescope.previewers.utils")
local get_jj_root = function()
local root, ret = ts_utils.get_os_command_output({ "jj", "root" })
if ret == 0 then
return root[1]
local path = vim.uv.fs_realpath(root[1])
return path
end

error("jj root not found")
Expand Down

0 comments on commit e65bbc2

Please sign in to comment.