From 14a37dfed125782a5a337b26c06201a30d02ca6e Mon Sep 17 00:00:00 2001 From: ziboh <42881496+ziboh@users.noreply.github.com> Date: Mon, 29 Jul 2024 14:50:57 +0800 Subject: [PATCH] feat: capture the preceding number for ChatRespond (#178) --- lua/gp/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/gp/init.lua b/lua/gp/init.lua index 25598af..6934db9 100644 --- a/lua/gp/init.lua +++ b/lua/gp/init.lua @@ -2429,9 +2429,11 @@ M.chat_respond = function(params) end M.cmd.ChatRespond = function(params) - if params.args == "" then + if params.args == "" and vim.v.count == 0 then M.chat_respond(params) return + elseif params.args == "" and vim.v.count ~= 0 then + params.args = tostring(vim.v.count) end -- ensure args is a single positive number