Skip to content

Commit

Permalink
fix: keep format command args
Browse files Browse the repository at this point in the history
fix #84
  • Loading branch information
lukas-reineke committed Apr 3, 2024
1 parent 5e18095 commit 3612642
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lua/lsp-format/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ end
M.setup = function(format_options)
M.format_options = vim.tbl_deep_extend("force", M.format_options, format_options or {})

vim.api.nvim_create_user_command("Format", function()
M.format { buf = vim.api.nvim_get_current_buf() }
vim.api.nvim_create_user_command("Format", function(args)
args.buf = vim.api.nvim_get_current_buf()
M.format(args)
end, { nargs = "*", bar = true, force = true })
vim.api.nvim_create_user_command(
"FormatToggle",
Expand Down

0 comments on commit 3612642

Please sign in to comment.