Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Jan 11, 2025
1 parent 8efb28f commit 59f333b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/fzf-lua/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,10 @@ function M.normalize_opts(opts, globals, __resume_key)
end
end

if type(opts.enrich) == "function" then
opts = opts.enrich(opts)
end

-- mark as normalized
opts._normalized = true

Expand Down
30 changes: 30 additions & 0 deletions lua/fzf-lua/profiles/hide.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
return {
desc = "hide interface instead of abort",
keymap = {
builtin = {
true,
["<Esc>"] = "hide",
["<M-Esc>"] = "abort",
},
},
defaults = {
enrich = function(opts)
opts.actions = vim.tbl_map(function(act)
act = type(act) == "function" and { fn = act } or act
act = type(act) == "table" and type(act[1]) == "function" and { fn = act[1], noclose = true } or act
assert(type(act) == "table" and type(act.fn) == "function" or not act)
if not act.exec_silent and not act.reload and not act.noclose then
act.exec_silent = true
act.fn = function(...)
require("fzf-lua").hide()
act.fn(...)
end
end
return act
end, opts.actions)
opts.actions["esc"] = false
_G.dump("o", opts.actions)
return opts
end,
},
}

0 comments on commit 59f333b

Please sign in to comment.