Add config.transitions to enable/disable transitions
This commit is contained in:
parent
7a35e7c217
commit
2353076b37
|
@ -20,6 +20,7 @@ config.tab_type = "soft"
|
||||||
config.line_limit = 80
|
config.line_limit = 80
|
||||||
config.max_symbols = 4000
|
config.max_symbols = 4000
|
||||||
config.max_project_files = 2000
|
config.max_project_files = 2000
|
||||||
|
config.transitions = true
|
||||||
|
|
||||||
-- Disable plugin loading setting to false the config entry
|
-- Disable plugin loading setting to false the config entry
|
||||||
-- of the same name.
|
-- of the same name.
|
||||||
|
|
|
@ -16,13 +16,12 @@ function View:new()
|
||||||
self.scrollable = false
|
self.scrollable = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function View:move_towards(t, k, dest, rate)
|
function View:move_towards(t, k, dest, rate)
|
||||||
if type(t) ~= "table" then
|
if type(t) ~= "table" then
|
||||||
return self:move_towards(self, t, k, dest, rate)
|
return self:move_towards(self, t, k, dest, rate)
|
||||||
end
|
end
|
||||||
local val = t[k]
|
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
|
t[k] = dest
|
||||||
else
|
else
|
||||||
t[k] = common.lerp(val, dest, rate or 0.5)
|
t[k] = common.lerp(val, dest, rate or 0.5)
|
||||||
|
|
Loading…
Reference in New Issue