fix zkgrep
parent
fbbc1dea98
commit
c5bf754ec8
|
@ -385,13 +385,14 @@ end)
|
||||||
-- match_ctor: string | {match= :string,...} | "" | nil
|
-- match_ctor: string | {match= :string,...} | "" | nil
|
||||||
require('zk.commands').add("ZkGrep", function(match_ctor)
|
require('zk.commands').add("ZkGrep", function(match_ctor)
|
||||||
-- handle polymorphic `match_ctor`
|
-- handle polymorphic `match_ctor`
|
||||||
local grep_str = ""
|
local grep_str = match_ctor
|
||||||
local match
|
local match
|
||||||
if match_ctor == nil or match_ctor == '' then
|
if match_ctor == nil or match_ctor == '' then
|
||||||
vim.fn.inputsave()
|
vim.fn.inputsave()
|
||||||
grep_str = vim.fn.input('Grep string: >')
|
grep_str = vim.fn.input('Grep string: >')
|
||||||
vim.fn.inputrestore()
|
vim.fn.inputrestore()
|
||||||
|
match = { match = grep_str }
|
||||||
|
elseif type(match_ctor) == 'string' then
|
||||||
match = { match = grep_str }
|
match = { match = grep_str }
|
||||||
end
|
end
|
||||||
require('zk').edit(match, { title = "Grep: '" .. grep_str .. "'" })
|
require('zk').edit(match, { title = "Grep: '" .. grep_str .. "'" })
|
||||||
|
|
Loading…
Reference in New Issue