From 7cdf7dc44f7d07babf16f0ca705f679d9b6805b7 Mon Sep 17 00:00:00 2001 From: rxi Date: Thu, 7 May 2020 14:03:37 +0100 Subject: [PATCH] Changed TreeView to first initialize its size in :update() --- data/plugins/treeview.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/data/plugins/treeview.lua b/data/plugins/treeview.lua index e429d75c..17cb1988 100644 --- a/data/plugins/treeview.lua +++ b/data/plugins/treeview.lua @@ -24,6 +24,7 @@ function TreeView:new() self.scrollable = true self.focusable = false self.visible = true + self.init_size = true self.cache = {} end @@ -126,7 +127,12 @@ end function TreeView:update() -- update width local dest = self.visible and config.treeview_size or 0 - self:move_towards(self.size, "x", dest) + if self.init_size then + self.size.x = dest + self.init_size = false + else + self:move_towards(self.size, "x", dest) + end TreeView.super.update(self) end @@ -182,7 +188,6 @@ end -- init local view = TreeView() local node = core.root_view:get_active_node() -view.size.x = config.treeview_size node:split("left", view, true) -- register commands and keymap