Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-x committed Sep 2, 2021
1 parent b517d7a commit d6f0249
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/go/format.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,17 @@ M.org_imports = function(wait_ms)
vim.lsp.buf.formatting()
end

M.goimport = function(...)
M.goimport = function(buf)
if _GO_NVIM_CFG.goimport == 'gopls' then
M.org_imports(1000)
return
end
local args = {...}
buf = buf or false
require("go.install").install(goimport)
require("go.install").install("golines")

if args and _GO_NVIM_CFG.goimport == 'goimports' then
run(goimport_args, true)
if _GO_NVIM_CFG.goimport == 'goimports' then
run(goimport_args, buf)
end
end

Expand Down

0 comments on commit d6f0249

Please sign in to comment.