Skip to content

Commit

Permalink
fix: passtrough resume query
Browse files Browse the repository at this point in the history
  • Loading branch information
phanen committed May 21, 2024
1 parent d21e147 commit 309c517
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
13 changes: 7 additions & 6 deletions lua/fzf-lua-overlay/init.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
local M = {}

local opts_fn = function(_)
local opts_fn = function(k)
if k == 'resume' then return {} end
return { query = table.concat(require('fzf-lua-overlay.util').getregion()) }
end

Expand All @@ -12,14 +13,14 @@ return setmetatable(M, {
__index = function(_, k)
return function(_opts)
local o = require('fzf-lua-overlay.overlay')[k]
local name, opts, fzf_exec_arg = o.name, o.opts, o.fzf_exec_arg
opts = vim.tbl_deep_extend('force', opts, opts_fn(k) or {})

if name == 'fzf_exec' then -- backend of new pickers (useless as api)
require('fzf-lua').fzf_exec(fzf_exec_arg, opts)
local opts = vim.tbl_deep_extend('force', o.opts, opts_fn(k) or {})

if o.name == 'fzf_exec' then -- backend of new pickers (useless as api)
require('fzf-lua').fzf_exec(o.fzf_exec_arg, opts)
else
opts = vim.tbl_deep_extend('force', opts, _opts or {})
require('fzf-lua')[name](opts)
require('fzf-lua')[o.name](opts)
end
-- local args = name == 'fzf_exec' and vim.F.pack_len(fzf_exec_arg, opts) or vim.F.pack_len(opts)
-- require('fzf-lua')[name](vim.F.unpack_len(args))
Expand Down
5 changes: 4 additions & 1 deletion lua/fzf-lua-overlay/overlay.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
-- local lsp_opt_fn = function() end

local overlay = setmetatable({
todo_comment = { name = 'grep', opts = { search = 'TODO|HACK|PERF|NOTE|FIX', no_esc = true } },
todo_comment = {
name = 'grep',
opts = { search = 'TODO|HACK|PERF|NOTE|FIX', no_esc = true },
},
}, {
__index = function(t, k)
local ok, ret = pcall(require, ('fzf-lua-overlay.providers.%s'):format(k))
Expand Down

0 comments on commit 309c517

Please sign in to comment.