From 3c024975fd27eaf23ef60ff8deb578e686bc8f7f Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Sun, 20 Apr 2025 12:48:22 +1000 Subject: [PATCH] refactor(#2826): singleton View class, WIP --- lua/nvim-tree/view.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lua/nvim-tree/view.lua b/lua/nvim-tree/view.lua index f8f3b592..de49a4e7 100644 --- a/lua/nvim-tree/view.lua +++ b/lua/nvim-tree/view.lua @@ -10,6 +10,12 @@ local Class = require("nvim-tree.classic") ---@field resize boolean|nil default true ---@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 ---@class (exact) View: Class @@ -100,12 +106,6 @@ function View:new(args) self.initial_width = self:get_width() end -local M = {} - -local DEFAULT_MIN_WIDTH = 30 -local DEFAULT_MAX_WIDTH = -1 -local DEFAULT_PADDING = 1 - -- The initial state of a tab local tabinitial = { -- The position of the cursor { line, column }