mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-24 04:34:34 +02:00
fix(autocmds): don't auto create dirs for urls. Fixes #583
This commit is contained in:
parent
1c06aa35ee
commit
7476da7811
1 changed files with 3 additions and 0 deletions
|
@ -72,6 +72,9 @@ 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
|
||||
return
|
||||
end
|
||||
local file = vim.loop.fs_realpath(event.match) or event.match
|
||||
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
|
||||
end,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue