Skip to content

Commit b7b1b98

Browse files
committed
perf(#3257): inline require legacy notify
1 parent 50e7e4c commit b7b1b98

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

lua/nvim-tree/legacy.lua

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
local notify = require("nvim-tree.notify")
2-
31
local M = {}
42

53
--- Create empty sub-tables if not present
@@ -120,25 +118,32 @@ end
120118
---@param u nvim_tree.config user supplied subset of config
121119
local function deprecated_config(u)
122120
if type(u.view) == "table" and u.view.hide_root_folder then
123-
notify.info("view.hide_root_folder is deprecated, please set renderer.root_folder_label = false")
121+
require("nvim-tree.notify").info(
122+
"view.hide_root_folder is deprecated, please set renderer.root_folder_label = false"
123+
)
124124
end
125125
end
126126

127127
---@param u nvim_tree.config user supplied subset of config
128128
local function removed_config(u)
129129
if u.auto_close then
130-
notify.warn("auto close feature has been removed: https://github.com/nvim-tree/nvim-tree.lua/wiki/Auto-Close")
130+
require("nvim-tree.notify").warn(
131+
"auto close feature has been removed: https://github.com/nvim-tree/nvim-tree.lua/wiki/Auto-Close"
132+
)
131133
u["auto_close"] = nil
132134
end
133135

134136
if u.focus_empty_on_setup then
135-
notify.warn("focus_empty_on_setup has been removed: https://github.com/nvim-tree/nvim-tree.lua/wiki/Open-At-Startup")
137+
require("nvim-tree.notify").warn(
138+
"focus_empty_on_setup has been removed: https://github.com/nvim-tree/nvim-tree.lua/wiki/Open-At-Startup"
139+
)
136140
u["focus_empty_on_setup"] = nil
137141
end
138142

139143
if u.create_in_closed_folder then
140-
notify.warn(
141-
"create_in_closed_folder has been removed and is now the default behaviour. You may use api.fs.create to add a file under your desired node.")
144+
require("nvim-tree.notify").warn(
145+
"create_in_closed_folder has been removed and is now the default behaviour. You may use api.fs.create to add a file under your desired node."
146+
)
142147
end
143148
u["create_in_closed_folder"] = nil
144149
end

0 commit comments

Comments
 (0)