From 3b6a30e336e5f497499172e2a91222eac611dac0 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 1 Feb 2025 10:49:14 +0800 Subject: [PATCH] perf(flygrep): update preview buf after C-p --- bundle/flygrep.nvim/lua/flygrep.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bundle/flygrep.nvim/lua/flygrep.lua b/bundle/flygrep.nvim/lua/flygrep.lua index bfdedd75b..01eeb2fb8 100644 --- a/bundle/flygrep.nvim/lua/flygrep.lua +++ b/bundle/flygrep.nvim/lua/flygrep.lua @@ -180,6 +180,8 @@ local function toggle_preview_win() winopt.row = start_row + math.floor((screen_height - 5) / 2) + 2 winopt.height = screen_height - 5 - math.floor((screen_height - 5) / 2) - 2 vim.api.nvim_win_set_config(result_winid, winopt) + vim.fn.timer_stop(preview_timer_id) + preview_timer_id = vim.fn.timer_start(500, preview_timer, { ['repeat'] = 1 }) else vim.api.nvim_win_close(preview_winid, true) local winopt = vim.api.nvim_win_get_config(result_winid)