mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-24 05:21:07 +00:00
Merge 648ff3849b into 459a4c3b10
This commit is contained in:
commit
b61c611400
1 changed files with 7 additions and 1 deletions
|
|
@ -67,7 +67,13 @@ function M.detectors.pattern(buf, patterns)
|
|||
end
|
||||
|
||||
function M.bufpath(buf)
|
||||
return M.realpath(vim.api.nvim_buf_get_name(assert(buf)))
|
||||
local name = LazyVim.norm(vim.api.nvim_buf_get_name(assert(buf)))
|
||||
local path = name and name:match("^term:/(.+/%d+):") or name
|
||||
-- fix duplicated drive letters for Windows
|
||||
if vim.fn.has("win32") == 1 and path and path:find(":/.*:/") then
|
||||
path = path:gsub("^.-%:/", "", 1)
|
||||
end
|
||||
return M.realpath(path)
|
||||
end
|
||||
|
||||
function M.cwd()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue