@@ -190,6 +190,13 @@ M.global = function(opts)
190190 or opts_copy )
191191 pickers [name ] = def
192192 end
193+ -- HACK: inherit fzf_opts from the normalized picker opts so we have
194+ -- with-nth for the transform (e.g. for blines)
195+ -- TODO: we can probably inerit all opts but I'm not sure what would be
196+ -- the effects of that, this entire picker needs refactoring
197+ local picker_opts = config .normalize_opts (t .opts , name :gsub (" ^lsp_" , " lsp." ))
198+ if not utils .map_get (def , " opts.fzf_opts" ) then utils .map_set (def , " opts.fzf_opts" , {}) end
199+ def .opts .fzf_opts = vim .tbl_deep_extend (" force" , def .opts .fzf_opts , picker_opts .fzf_opts )
193200 -- Instantiate the previewer, opts isn't guaranteed if the picker
194201 -- isn't avilable, e.g. `tags` when not tags file exists
195202 if def .opts and def .opts .previewer then
@@ -249,6 +256,14 @@ M.global = function(opts)
249256 win :redraw_preview ()
250257 end
251258 reload = string.format (" reload(%s)+" , new_picker .contents )
259+ -- fzf >= 0.69 supports `change-with-nth` to dynamically change `--with-nth`
260+ -- dynamically update `--with-nth` per-picker (fzf >= 0.69)
261+ -- e.g. blines uses `--with-nth=4..` to hide buffer numbers
262+ if utils .has (opts , " fzf" , { 0 , 69 }) then
263+ -- `false|nil` defaults to all fields (..)
264+ local with_nth = utils .map_get (new_picker , " opts.fzf_opts.--with-nth" )
265+ reload = reload .. string.format (" change-with-nth(%s)+" , with_nth or " .." )
266+ end
252267 cur_sub = new_sub
253268 cur_picker = new_picker
254269 end
0 commit comments