Skip to content

Commit 3d2cbb8

Browse files
phanenibhagwan
authored andcommitted
chore: sort debugprint
chore: print -> utils.info to avoid populate msg in test runner
1 parent 70cdea3 commit 3d2cbb8

3 files changed

Lines changed: 6 additions & 11 deletions

File tree

lua/fzf-lua/core.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ M.fzf = function(contents, opts)
370370
pipe_cmd = opts.pipe_cmd,
371371
silent_fail = opts.silent_fail,
372372
is_fzf_tmux = opts._is_fzf_tmux,
373-
debug = opts.debug == true or opts.debug == "verbose",
373+
debug = opts.debug,
374374
RIPGREP_CONFIG_PATH = opts.RIPGREP_CONFIG_PATH,
375375
})
376376
-- kill fzf piped process PID

lua/fzf-lua/fzf.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ function M.raw_fzf(contents, fzf_cli_args, opts)
116116
end
117117

118118
if opts.debug then
119-
print("[Fzf-lua]: FZF_DEFAULT_COMMAND:", FZF_DEFAULT_COMMAND)
120-
print("[Fzf-lua]: fzf cmd:", table.concat(cmd, " "))
119+
utils.info("FZF_DEFAULT_COMMAND: %s", tostring(FZF_DEFAULT_COMMAND))
120+
utils.info("fzf cmd: %s", table.concat(cmd, " "))
121121
end
122122

123123
local co = coroutine.running()

lua/fzf-lua/libuv.lua

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -389,12 +389,7 @@ M.spawn_stdio = function(opts)
389389
end
390390

391391
-- setup global vars
392-
for k, v in pairs(opts.g or {}) do
393-
_G[k] = v
394-
if opts.debug == "v" or opts.debug == "verbose" then
395-
io.stdout:write(string.format("[DEBUG] %s=%s" .. (k ~= "_EOL" and EOL or ""), k, v))
396-
end
397-
end
392+
for k, v in pairs(opts.g or {}) do _G[k] = v end
398393

399394
-- Requiring make_entry will create the pseudo `_G.FzfLua` global
400395
-- Must be called after global vars are created or devicons will
@@ -418,8 +413,8 @@ M.spawn_stdio = function(opts)
418413
end
419414

420415
if opts.debug == "v" or opts.debug == "verbose" then
421-
for k, v in pairs(opts) do
422-
io.stdout:write(string.format("[DEBUG] %s=%s" .. EOL, k, tostring(v)))
416+
for k, v in vim.spairs(opts) do
417+
io.stdout:write(string.format("[DEBUG] %s=%s" .. EOL, k, vim.inspect(v)))
423418
end
424419
elseif opts.debug then
425420
io.stdout:write("[DEBUG] [mt] " .. opts.cmd .. EOL)

0 commit comments

Comments
 (0)