From 91170cab095f40f78c5e30fe4441470d6b211ab9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 31 Mar 2024 20:36:45 +0800 Subject: [PATCH] feat(recordkey): remove key via timer --- lua/spacevim/plugin/record-key.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/spacevim/plugin/record-key.lua b/lua/spacevim/plugin/record-key.lua index fced9cc78..a6492d633 100644 --- a/lua/spacevim/plugin/record-key.lua +++ b/lua/spacevim/plugin/record-key.lua @@ -62,6 +62,11 @@ end local function on_key(key) table.insert(keys, key) + vim.fn.timer_start(timeout, function() + if #keys > 0 then + table.remove(keys, 1) + end + end, { ['repeat'] = 1 }) display() end