Skip to content

Commit

Permalink
fix: Format command
Browse files Browse the repository at this point in the history
fix #73
  • Loading branch information
lukas-reineke committed Jan 24, 2024
1 parent 31fc250 commit 5e18095
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/lsp-format/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +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", M.format, { nargs = "*", bar = true, force = true })
vim.api.nvim_create_user_command("Format", function()
M.format { buf = vim.api.nvim_get_current_buf() }
end, { nargs = "*", bar = true, force = true })
vim.api.nvim_create_user_command(
"FormatToggle",
M.toggle,
Expand Down

0 comments on commit 5e18095

Please sign in to comment.