fix(autocmds): auto create directory on windows for uris. Fixes #2442

This commit is contained in:
Folke Lemaitre 2024-03-26 20:48:50 +01:00
parent 1910cd5cb7
commit 7d570fad79
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -106,7 +106,7 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
group = augroup("auto_create_dir"),
callback = function(event)
if event.match:match("^%w%w+://") then
if event.match:match("^%w%w+:[\\/][\\/]") then
return
end
local file = vim.uv.fs_realpath(event.match) or event.match