Skip to content

Commit b3b848f

Browse files
committed
Ignore windows drives
1 parent edbf62f commit b3b848f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lua/nvim-tree/utils.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,10 @@ function M.rename_loaded_buffers(old_path, new_path)
289289
end
290290
end
291291

292+
local is_windows_drive = function(path)
293+
return (M.is_windows) and (path:match('^%a:\\$') ~= nil)
294+
end
295+
292296
---@param path string path to file or directory
293297
---@return boolean
294298
function M.file_exists(path)
@@ -306,6 +310,10 @@ function M.file_exists(path)
306310
-- access Windows files directly.
307311
-- For more details see (#3117).
308312

313+
if is_windows_drive(path) then
314+
return vim.fn.isdirectory(path) == 1
315+
end
316+
309317
local parent = vim.fn.fnamemodify(path, ":h")
310318
local filename = vim.fn.fnamemodify(path, ":t")
311319

0 commit comments

Comments
 (0)