Skip to content

Commit

Permalink
fix(cli): do not print result
Browse files Browse the repository at this point in the history
  • Loading branch information
lewis6991 committed Apr 3, 2024
1 parent 096d083 commit 7e31d81
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lua/gitsigns/cli.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ function M.complete(arglead, line)
return matches
end

local function print_nonnil(x)
if x ~= nil then
print(vim.inspect(x))
end
end

M.run = async.create(1, function(params)
local __FUNC__ = 'cli.run'
local pos_args_raw, named_args_raw = parse_args(params.args)
Expand Down Expand Up @@ -95,15 +89,15 @@ M.run = async.create(1, function(params)
if cmd_func then
-- Action has a specialised mapping function from command form to lua
-- function
print_nonnil(cmd_func(args, params))
cmd_func(args, params)
return
end

for m, has_named in pairs(sources) do
local f = m[func]
if type(f) == 'function' then
-- Note functions here do not have named arguments
print_nonnil(f(unpack(pos_args), has_named and named_args or nil))
f(unpack(pos_args), has_named and named_args or nil)
return
end
end
Expand Down

0 comments on commit 7e31d81

Please sign in to comment.