From 5a24869fab079aaf587b71e0e66f0e421e1de3c7 Mon Sep 17 00:00:00 2001 From: wongxy Date: Thu, 14 Jul 2022 18:55:12 +0800 Subject: [PATCH] chore: reduce the delay `refresh` is actually very cheap --- plugin/virtcolumn.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/virtcolumn.lua b/plugin/virtcolumn.lua index d5b60eb..c050a18 100644 --- a/plugin/virtcolumn.lua +++ b/plugin/virtcolumn.lua @@ -106,7 +106,7 @@ local function refresh(args) winscrolled_timer:stop() winscrolled_timer:close() end - winscrolled_timer = vim.defer_fn(_refresh, 150) + winscrolled_timer = vim.defer_fn(_refresh, 100) elseif event:match "TextChanged" then if textchanged_timer and textchanged_timer:is_active() then textchanged_timer:stop() @@ -116,9 +116,9 @@ local function refresh(args) local delay if lines_count ~= vim.b.virtcolumn_lines_count then vim.b.virtcolumn_lines_count = lines_count - delay = 50 + delay = 15 else - delay = 500 + delay = 150 end textchanged_timer = vim.defer_fn(_refresh, delay) else