@@ -293,10 +293,10 @@ M.stringify = function(contents, opts, fzf_field_index)
293293 assert (not opts .__stringified , " twice stringified" )
294294 opts .__stringified = true
295295
296- -- Convert string callbacks to callback functions
297- for _ , k in ipairs ({ " fn_transform" , " fn_preprocess" , " fn_postprocess" }) do
298- opts [k ] = libuv .load_fn (opts [k ]) or opts [k ]
299- end
296+ -- -- Convert string callbacks to callback functions
297+ -- for _, k in ipairs({ "fn_transform", "fn_preprocess", "fn_postprocess" }) do
298+ -- opts[k] = libuv.load_fn(opts[k]) or opts[k]
299+ -- end
300300
301301 local cmd , id = M .pipe_wrap_fn (function (pipe , ...)
302302 local args , n = { ... }, select (" #" , ... )
@@ -318,14 +318,8 @@ M.stringify = function(contents, opts, fzf_field_index)
318318 local write_cb_count = 0
319319 local pipe_want_close = false
320320 local EOL = utils .map_get (opts , " fzf_opts.--read0" ) and " \0 " or " \n "
321- local fn_transform = opts .fn_transform
322- local fn_preprocess = opts .fn_preprocess
323- local fn_postprocess = opts .fn_postprocess
324321 local co = coroutine.running ()
325322
326- -- Run the preprocess function
327- if type (fn_preprocess ) == " function" then fn_preprocess (opts ) end
328-
329323 -- local on_finish = function(code, sig, from, pid)
330324 -- print("finish", pipe, pipe_want_close, code, sig, from, pid)
331325 local on_finish = function (_ , _ , _ , _ )
@@ -335,8 +329,7 @@ M.stringify = function(contents, opts, fzf_field_index)
335329 -- only close if all our uv.write calls are completed
336330 uv .close (pipe )
337331 pipe = nil
338- -- Run the postprocess function
339- if type (fn_postprocess ) == " function" then fn_postprocess (opts ) end
332+ -- if type(fn_postprocess) == "function" then fn_postprocess(opts) end
340333 end
341334 end
342335
@@ -349,23 +342,6 @@ M.stringify = function(contents, opts, fzf_field_index)
349342 if cb then cb (nil ) end
350343 else
351344 write_cb_count = write_cb_count + 1
352- if type (data ) == " table" then
353- -- cb_write_lines was sent instead of cb_lines
354- if fn_transform then
355- -- safely remove items while iterating
356- local i = 1
357- while i <= # data do
358- local v = fn_transform (data [i ], opts )
359- if not v then
360- table.remove (data , i )
361- else
362- data [i ] = v
363- i = i + 1
364- end
365- end
366- end
367- data = # data > 0 and (table.concat (data , EOL ) .. EOL ) or " "
368- end
369345 uv .write (pipe , tostring (data ), function (err )
370346 write_cb_count = write_cb_count - 1
371347 if cb then cb (err ) end
@@ -388,9 +364,6 @@ M.stringify = function(contents, opts, fzf_field_index)
388364 end
389365
390366 if type (contents ) == " string" then
391- -- Use queue in libuv.spawn by default
392- opts .use_queue = opts .use_queue == nil and true or opts .use_queue
393-
394367 -- Throttle pipe writes by default
395368 -- opts.throttle = opts.throttle == nil and true or opts.throttle
396369
@@ -410,18 +383,11 @@ M.stringify = function(contents, opts, fzf_field_index)
410383 cmd = contents ,
411384 env = env ,
412385 cb_finish = on_finish ,
413- -- cb_write_lines = on_write,
414386 cb_write = on_write ,
415387 cb_pid = function (pid ) if opts .PidObject then opts .PidObject :set (pid ) end end ,
416- process1 = opts .process1 ,
417- profiler = opts .profiler ,
418- use_queue = opts .use_queue ,
419388 EOL = EOL ,
420389 opts = opts ,
421- -- Must send value, 'coroutinify' adds callback as last argument
422- -- which will conflict with the 'fn_transform' argument
423- -- send true to force line processing without transformation
424- }, fn_transform )
390+ })
425391 else
426392 -- callback with newline
427393 local on_write_nl = function (data , cb )
0 commit comments