@@ -11,26 +11,6 @@ local libuv = require "fzf-lua.libuv"
1111
1212local M = {}
1313
14- -- workaround to a potential 'tempname' bug? (#222)
15- -- neovim doesn't guarantee the existence of the
16- -- parent temp dir potentially failing `mkfifo`
17- -- https://github.com/neovim/neovim/issues/1432
18- -- https://github.com/neovim/neovim/pull/11284
19- local function tempname ()
20- local tmpname = vim .fn .tempname ()
21- local parent = vim .fn .fnamemodify (tmpname , " :h" )
22- -- parent must exist for `mkfifo` to succeed
23- -- if the neovim temp dir was deleted or the
24- -- tempname already exists, we use 'os.tmpname'
25- if not uv .fs_stat (parent ) or uv .fs_stat (tmpname ) then
26- tmpname = os.tmpname ()
27- -- 'os.tmpname' touches the file which
28- -- will also fail `mkfifo`, delete it
29- vim .fn .delete (tmpname )
30- end
31- return tmpname
32- end
33-
3414-- contents can be either a table with tostring()able items, or a function that
3515-- can be called repeatedly for values. The latter can use coroutines for async
3616-- behavior.
@@ -48,7 +28,7 @@ function M.raw_fzf(contents, fzf_cli_args, opts)
4828
4929 if not opts then opts = {} end
5030 local cmd = { opts .fzf_bin or " fzf" }
51- local outputtmpname = tempname ()
31+ local outputtmpname = utils . tempname ()
5232
5333 -- we use a temporary env $FZF_DEFAULT_COMMAND instead of piping
5434 -- the command to fzf, this way fzf kills the command when it exits.
0 commit comments