Skip to content

Commit 9c1a40b

Browse files
author
Olivier Roques
committed
Support function actions
Closes #27
1 parent 68affe4 commit 9c1a40b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lua/lspfuzzy.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ local function jump(entries)
6767

6868
local key = table.remove(entries, 1)
6969
local locations = vim.tbl_map(fzf_to_lsp, entries)
70+
local action = opts.fzf_action[key]
71+
72+
if type(action) == 'function' then
73+
action(entries)
74+
action = nil
75+
end
7076

7177
-- Use the quickfix list to store remaining locations
7278
if #locations > 1 then
@@ -75,7 +81,7 @@ local function jump(entries)
7581
cmd 'wincmd p'
7682
end
7783

78-
jump_to_location(opts.fzf_action[key], locations[1])
84+
jump_to_location(action, locations[1])
7985
end
8086

8187
local function apply_action(entries)

0 commit comments

Comments
 (0)