Skip to content

fix: add legacy options safety #2420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lua/nvim-tree/legacy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ local function refactored(opts)
utils.move_missing_val(opts, "trash", "require_confirm", opts, "ui.confirm", "trash", true)

-- 2023/01/15
if opts.view and opts.view.adaptive_size ~= nil then
if type(opts.view) == "table" and opts.view.adaptive_size ~= nil then
if opts.view.adaptive_size and type(opts.view.width) ~= "table" then
local width = opts.view.width
opts.view.width = {
Expand Down Expand Up @@ -52,7 +52,7 @@ local function refactored(opts)
end

local function deprecated(opts)
if opts.view and opts.view.hide_root_folder then
if type(opts.view) == "table" and opts.view.hide_root_folder then
notify.info "view.hide_root_folder is deprecated, please set renderer.root_folder_label = false"
end
end
Expand Down