diff --git a/lua/fzf-lua/defaults.lua b/lua/fzf-lua/defaults.lua index 7260f3aa..042e1772 100644 --- a/lua/fzf-lua/defaults.lua +++ b/lua/fzf-lua/defaults.lua @@ -144,7 +144,7 @@ M.defaults = { args = "--italic-text=always --style=numbers,changes --color always", theme = nil, config = nil, - _ctor = previewers.fzf.bat, + _ctor = previewers.fzf.bat_async, }, bat_native = { cmd = "bat", diff --git a/lua/fzf-lua/providers/tags.lua b/lua/fzf-lua/providers/tags.lua index 9e4ba30f..ab9c7286 100644 --- a/lua/fzf-lua/providers/tags.lua +++ b/lua/fzf-lua/providers/tags.lua @@ -52,7 +52,7 @@ local function tags(opts) opts.__module__ = opts.__module__ or "tags" -- make sure we have the correct 'bat' previewer for tags - if opts.previewer == "bat" then opts.previewer = "bat_async" end + if opts.previewer == "bat_native" then opts.previewer = "bat_async" end -- signal actions this is a ctag opts._ctag = true diff --git a/lua/fzf-lua/shell.lua b/lua/fzf-lua/shell.lua index b587c1b0..dce9dc57 100644 --- a/lua/fzf-lua/shell.lua +++ b/lua/fzf-lua/shell.lua @@ -141,10 +141,14 @@ M.raw_preview_action_cmd = function(fn, fzf_field_expression, debug) end end + libuv.process_kill(M.__pid_preview) + M.__pid_preview = nil + return libuv.spawn({ cmd = fn(...), cb_finish = on_finish, cb_write = on_write, + cb_pid = function(pid) M.__pid_preview = pid end, }, false) end, fzf_field_expression, debug) end