From a197f751f97c1b050916a8453acba914569b7bb5 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 30 Nov 2022 23:13:35 +0100 Subject: [PATCH] feat: config option for ui throttle --- lua/lazy/core/config.lua | 1 + lua/lazy/view/init.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/lazy/core/config.lua b/lua/lazy/core/config.lua index ae751ce..6fa55a1 100644 --- a/lua/lazy/core/config.lua +++ b/lua/lazy/core/config.lua @@ -37,6 +37,7 @@ M.defaults = { -- defaults for `Lazy log` log = { "-10" }, -- last 10 commits -- log = { "--since=3 days ago" }, -- commits from the last 3 days + throttle = 20, -- how frequently should the ui process render events }, } diff --git a/lua/lazy/view/init.lua b/lua/lazy/view/init.lua index c7007c0..645ef38 100644 --- a/lua/lazy/view/init.lua +++ b/lua/lazy/view/init.lua @@ -98,7 +98,7 @@ function M.show(mode) }) local render = Render.new(buf, win, 2) - local update = Util.throttle(30, function() + local update = Util.throttle(Config.options.ui.throttle, function() if buf and vim.api.nvim_buf_is_valid(buf) then vim.bo[buf].modifiable = true render:update()