From 2353076b3755fda18fa6d247640ea6765a5790fc Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Sun, 21 Feb 2021 11:08:25 +0100 Subject: [PATCH] Add config.transitions to enable/disable transitions --- data/core/config.lua | 1 + data/core/view.lua | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/core/config.lua b/data/core/config.lua index fb1e0fa..fcb2499 100644 --- a/data/core/config.lua +++ b/data/core/config.lua @@ -20,6 +20,7 @@ config.tab_type = "soft" config.line_limit = 80 config.max_symbols = 4000 config.max_project_files = 2000 +config.transitions = true -- Disable plugin loading setting to false the config entry -- of the same name. diff --git a/data/core/view.lua b/data/core/view.lua index ae978a9..4d49959 100644 --- a/data/core/view.lua +++ b/data/core/view.lua @@ -16,13 +16,12 @@ function View:new() self.scrollable = false end - function View:move_towards(t, k, dest, rate) if type(t) ~= "table" then return self:move_towards(self, t, k, dest, rate) end local val = t[k] - if math.abs(val - dest) < 0.5 then + if not config.transitions or math.abs(val - dest) < 0.5 then t[k] = dest else t[k] = common.lerp(val, dest, rate or 0.5)