style(format): minor fixes
This commit is contained in:
+8
-8
@@ -161,9 +161,9 @@ end
|
|||||||
--- * %col_end% - last column position of selection
|
--- * %col_end% - last column position of selection
|
||||||
--- * %byte_start% - byte count of first cell in selection
|
--- * %byte_start% - byte count of first cell in selection
|
||||||
--- * %byte_end% - byte count of last cell in selection
|
--- * %byte_end% - byte count of last cell in selection
|
||||||
---@field output OutputStream What stream to use as the result. May be one of `stdout` or `stderr`.
|
---@field output OutputStream What stream to use as the result. May be one of `stdout`, `stderr` or `in_place`.
|
||||||
---@field auto_indent? boolean Perform auto indent on formatted range. False by default.
|
---@field auto_indent? boolean Perform auto indent on formatted range
|
||||||
---@field only_selection? boolean Only send the selected lines to `stdin`. False by default.
|
---@field only_selection? boolean Only send the selected lines to `stdin`
|
||||||
---@field ignore_ret? boolean Ignore non-zero return codes
|
---@field ignore_ret? boolean Ignore non-zero return codes
|
||||||
---@field ignore_stderr? boolean Ignore stderr output when not using stderr for output
|
---@field ignore_stderr? boolean Ignore stderr output when not using stderr for output
|
||||||
---@field env? table<string, string> Map of environment variables
|
---@field env? table<string, string> Map of environment variables
|
||||||
@@ -194,6 +194,7 @@ function M.format(opts)
|
|||||||
|
|
||||||
local file = vim.fn.expand("%")
|
local file = vim.fn.expand("%")
|
||||||
local filename = vim.fn.expand("%:t")
|
local filename = vim.fn.expand("%:t")
|
||||||
|
|
||||||
local mode = vim.fn.mode()
|
local mode = vim.fn.mode()
|
||||||
local is_visual = mode == "v" or mode == "V" or mode == ""
|
local is_visual = mode == "v" or mode == "V" or mode == ""
|
||||||
|
|
||||||
@@ -257,13 +258,13 @@ function M.format(opts)
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
stderr = not opts.ignore_stderr and function(e, data)
|
stderr = not opts.ignore_stderr and function(e, data)
|
||||||
if data then
|
|
||||||
stderr = stderr and stderr .. data or data
|
|
||||||
end
|
|
||||||
|
|
||||||
if e then
|
if e then
|
||||||
err = err and err .. e or e
|
err = err and err .. e or e
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if data then
|
||||||
|
stderr = stderr and stderr .. data or data
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
env = opts.env,
|
env = opts.env,
|
||||||
}):wait()
|
}):wait()
|
||||||
@@ -439,5 +440,4 @@ function M.get_hl_source(name)
|
|||||||
return hl
|
return hl
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|||||||
Reference in New Issue
Block a user