1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 07:00:04 +08:00

feat(format): support :Format! filetype

This commit is contained in:
Eric Wong 2024-04-16 14:00:20 +08:00
parent a7fbe2415b
commit 545a3bc5fa

View File

@ -11,6 +11,10 @@ function M.format(bang, user_input, start_line, end_line)
end
local filetype = vim.o.filetype
local argvs = vim.split(user_input, '%s+')
if bang and #argvs > 0 then
filetype = argvs[1]
end
if filetype == '' then
return util.msg('format: skip empty filetype')