4242
4343--- Runs fzf-lua to select and navigate to from a list of TOC items.
4444---
45- --- @param layers string ? The layers to filter. Can be a substring of ` ctli`
46- --- corresponding to content, todos, labels, and includes.
45+ --- @param options table ? Available options :
46+ --- - layers: The layers to filter. Can be a substring of `ctli`
47+ --- corresponding to content, todos, labels, and includes.
48+ --- - fzf_opts: list of options for fzf_exec
4749--- @return nil
48- M .run = function (layers )
49- if layers == nil then
50- layers = " ctli"
50+ M .run = function (options )
51+ local layers = " ctli"
52+ if options ~= nil and options [" layers" ] ~= nil then
53+ layers = options [" layers" ]
54+ options [" layers" ] = nil
5155 end
5256
5357 local fzf = require " fzf-lua"
@@ -68,11 +72,16 @@ M.run = function(layers)
6872 )
6973 end , entries )
7074
75+ local fzfoptions = {
76+ [" --delimiter" ] = " ####" ,
77+ [" --with-nth" ] = " {2} {3}" ,
78+ }
79+ if options ~= nil and options [" fzf_opts" ] ~= nil then
80+ fzfoptions = vim .tbl_extend (' force' , fzfoptions , options [" fzf_opts" ])
81+ end
82+
7183 fzf .fzf_exec (fzf_entries , {
72- fzf_opts = {
73- [" --delimiter" ] = " ####" ,
74- [" --with-nth" ] = " {2} {3}" ,
75- },
84+ fzf_opts = fzfoptions ,
7685 actions = {
7786 default = function (selection , o )
7887 local s = vim .tbl_map (function (t )
0 commit comments