Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions lua/nvim-tree/actions/tree/resize.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local view = require("nvim-tree.view")
local view_state = require("nvim-tree.view-state")

local M = {}

Expand All @@ -7,7 +8,7 @@ local M = {}
function M.fn(opts)
if opts == nil then
-- reset to config values
view.configure_width()
view_state.configure_width()
view.resize()
return
end
Expand All @@ -16,7 +17,7 @@ function M.fn(opts)
local width_cfg = options.width

if width_cfg ~= nil then
view.configure_width(width_cfg)
view_state.configure_width(width_cfg)
view.resize()
return
end
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim-tree/view-state.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ end

---Configure width-related config
---@param width string|function|number|table|nil
local function configure_width(width)
function M.configure_width(width)
if type(width) == "table" then
M.Active.adaptive_size = true
M.Active.width = width.min or DEFAULT_MIN_WIDTH
Expand Down Expand Up @@ -101,7 +101,7 @@ function M.initialize()
M.Active.winopts.relativenumber = config.g.view.relativenumber
M.Active.winopts.signcolumn = config.g.view.signcolumn

configure_width(config.g.view.width)
M.configure_width(config.g.view.width)

M.Active.initial_width = M.get_width()
end
Expand Down
Loading