From c5bf754ec85b326366dd08698a8e64a99b7a29ff Mon Sep 17 00:00:00 2001 From: pegasust Date: Wed, 31 Aug 2022 08:13:43 -0700 Subject: [PATCH] fix zkgrep --- neovim/init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/neovim/init.lua b/neovim/init.lua index 71ba3cd..3667696 100644 --- a/neovim/init.lua +++ b/neovim/init.lua @@ -385,13 +385,14 @@ end) -- match_ctor: string | {match= :string,...} | "" | nil require('zk.commands').add("ZkGrep", function(match_ctor) -- handle polymorphic `match_ctor` - local grep_str = "" + local grep_str = match_ctor local match if match_ctor == nil or match_ctor == '' then vim.fn.inputsave() grep_str = vim.fn.input('Grep string: >') vim.fn.inputrestore() - + match = { match = grep_str } + elseif type(match_ctor) == 'string' then match = { match = grep_str } end require('zk').edit(match, { title = "Grep: '" .. grep_str .. "'" })