feat(#2270): add notify.absolute_path - show file or absolute path (default) names with notifications (#2286)

Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
Asror
2023-06-24 23:06:21 -04:00
committed by GitHub
parent 7aff29d755
commit 3cc698b35b
7 changed files with 38 additions and 16 deletions

View File

@@ -12,7 +12,7 @@ local function create_and_notify(file)
events._dispatch_will_create_file(file)
local ok, fd = pcall(vim.loop.fs_open, file, "w", 420)
if not ok then
notify.error("Couldn't create file " .. file)
notify.error("Couldn't create file " .. notify.render_path(file))
return
end
vim.loop.fs_close(fd)
@@ -81,7 +81,7 @@ function M.fn(node)
elseif not utils.file_exists(path_to_create) then
local success = vim.loop.fs_mkdir(path_to_create, 493)
if not success then
notify.error("Could not create folder " .. path_to_create)
notify.error("Could not create folder " .. notify.render_path(path_to_create))
is_error = true
break
end
@@ -89,7 +89,7 @@ function M.fn(node)
end
end
if not is_error then
notify.info(new_file_path .. " was properly created")
notify.info(notify.render_path(new_file_path) .. " was properly created")
end
-- synchronously refreshes as we can't wait for the watchers