feat(notify): add notify.threshold (#1693)
* feat: configurable notification level add `notify.threshold` to setup opts * feat: configurable notification level: add threshold example doc * feat: configurable notification level: log always comes last Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
@@ -3,6 +3,7 @@ local uv = vim.loop
|
||||
local lib = require "nvim-tree.lib"
|
||||
local utils = require "nvim-tree.utils"
|
||||
local events = require "nvim-tree.events"
|
||||
local notify = require "nvim-tree.notify"
|
||||
|
||||
local M = {}
|
||||
|
||||
@@ -12,15 +13,15 @@ end
|
||||
|
||||
function M.rename(node, to)
|
||||
if utils.file_exists(to) then
|
||||
utils.notify.warn(err_fmt(node.absolute_path, to, "file already exists"))
|
||||
notify.warn(err_fmt(node.absolute_path, to, "file already exists"))
|
||||
return
|
||||
end
|
||||
|
||||
local success, err = uv.fs_rename(node.absolute_path, to)
|
||||
if not success then
|
||||
return utils.notify.warn(err_fmt(node.absolute_path, to, err))
|
||||
return notify.warn(err_fmt(node.absolute_path, to, err))
|
||||
end
|
||||
utils.notify.info(node.absolute_path .. " ➜ " .. to)
|
||||
notify.info(node.absolute_path .. " ➜ " .. to)
|
||||
utils.rename_loaded_buffers(node.absolute_path, to)
|
||||
events._dispatch_node_renamed(node.absolute_path, to)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user