mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
expand "." to cwd on Windows
`LazyVim.root.detectors.pattern` returns `.` when the pattern matches in the current directory. If we do not expand the directory, Snacks will consider the current terminal window is for another directory. Instead of hiding the window, Snacks opens a new terminal window instead.
This commit is contained in:
parent
6055e59613
commit
2f935df27b
1 changed files with 5 additions and 1 deletions
|
|
@ -78,7 +78,11 @@ function M.realpath(path)
|
||||||
if path == "" or path == nil then
|
if path == "" or path == nil then
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
path = vim.fn.has("win32") == 0 and vim.uv.fs_realpath(path) or path
|
if vim.fn.has("win32") == 0 then
|
||||||
|
path = vim.uv.fs_realpath(path)
|
||||||
|
elseif path == "." then
|
||||||
|
path = vim.uv.cwd()
|
||||||
|
end
|
||||||
return LazyVim.norm(path)
|
return LazyVim.norm(path)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue