Skip to content

Commit 5d47b64

Browse files
committed
perf(#3257): remove notify setup
1 parent 697a42b commit 5d47b64

2 files changed

Lines changed: 7 additions & 14 deletions

File tree

lua/nvim-tree.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ function M.setup(config_user)
277277

278278
manage_netrw()
279279

280-
require("nvim-tree.notify").setup(config.g)
281280
require("nvim-tree.log").setup(config.g)
282281

283282
if log.enabled("config") then

lua/nvim-tree/notify.lua

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
local M = {}
1+
local config = require("nvim-tree.config")
22

3-
local config = {
4-
threshold = vim.log.levels.INFO,
5-
absolute_path = true,
6-
}
3+
local M = {}
74

85
local title_support
96
---@return boolean
@@ -27,8 +24,11 @@ local modes = {
2724
}
2825

2926
do
27+
---@param level vim.log.levels
28+
---@param msg string
3029
local dispatch = function(level, msg)
31-
if level < config.threshold or not msg then
30+
local threshold = config.g and config.g.notify.threshold or config.d.notify.threshold
31+
if level < threshold or not msg then
3232
return
3333
end
3434

@@ -52,17 +52,11 @@ end
5252
---@param path string
5353
---@return string
5454
function M.render_path(path)
55-
if config.absolute_path then
55+
if config.g and config.g.notify.absolute_path then
5656
return path
5757
else
5858
return vim.fn.fnamemodify(path .. "/", ":h:t")
5959
end
6060
end
6161

62-
function M.setup(opts)
63-
opts = opts or {}
64-
config.threshold = opts.notify.threshold or vim.log.levels.INFO
65-
config.absolute_path = opts.notify.absolute_path
66-
end
67-
6862
return M

0 commit comments

Comments
 (0)