refactor(#2826): singleton View class, WIP

This commit is contained in:
Alexander Courtis 2025-04-20 12:48:22 +10:00
parent fa64574f16
commit 3c024975fd

View File

@ -10,6 +10,12 @@ local Class = require("nvim-tree.classic")
---@field resize boolean|nil default true ---@field resize boolean|nil default true
---@field winid number|nil 0 or nil for current ---@field winid number|nil 0 or nil for current
local M = {}
local DEFAULT_MIN_WIDTH = 30
local DEFAULT_MAX_WIDTH = -1
local DEFAULT_PADDING = 1
--TODO attempt to type the tables, at least the options ones --TODO attempt to type the tables, at least the options ones
---@class (exact) View: Class ---@class (exact) View: Class
@ -100,12 +106,6 @@ function View:new(args)
self.initial_width = self:get_width() self.initial_width = self:get_width()
end end
local M = {}
local DEFAULT_MIN_WIDTH = 30
local DEFAULT_MAX_WIDTH = -1
local DEFAULT_PADDING = 1
-- The initial state of a tab -- The initial state of a tab
local tabinitial = { local tabinitial = {
-- The position of the cursor { line, column } -- The position of the cursor { line, column }