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

@@ -2,6 +2,7 @@ local M = {}
local config = {
threshold = vim.log.levels.INFO,
absolute_path = true,
}
local modes = {
@@ -30,9 +31,18 @@ do
end
end
function M.render_path(path)
if config.absolute_path then
return path
else
return vim.fn.fnamemodify(path .. "/", ":h:t")
end
end
function M.setup(opts)
opts = opts or {}
config.threshold = opts.notify.threshold or vim.log.levels.INFO
config.absolute_path = opts.notify.absolute_path
end
return M