fix(format): don't use 'string.format' when formatting (#103)

* refactor(format): don't use string.format when formatting

* chore(luarc): disable third party check
This commit is contained in:
linrongbin16 2023-11-07 14:40:39 +08:00 committed by GitHub
parent be64a091b0
commit d671304da3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 9 deletions

View file

@ -1,4 +1,4 @@
{
"diagnostics.globals": ["vim", "describe", "before_each", "it"],
"workspace.checkThirdParty": false
"workspace.checkThirdParty": "Disable"
}

View file

@ -84,8 +84,7 @@ local Defaults = {
has_title = true
end
if type(message) == "string" and string.len(message) > 0 then
local escaped = message:gsub("%%", "%%%%")
table.insert(builder, escaped)
table.insert(builder, message)
has_message = true
end
if percentage and (has_title or has_message) then
@ -113,12 +112,10 @@ local Defaults = {
--- `client_messages` array, or ignored if return nil.
client_format = function(client_name, spinner, series_messages)
return #series_messages > 0
and string.format(
"[%s] %s %s",
client_name,
spinner,
table.concat(series_messages, ", ")
)
and ("[" .. client_name .. "] " .. spinner .. " " .. table.concat(
series_messages,
", "
))
or nil
end,