Skip to content

Commit 6804956

Browse files
author
jolly[bot]
committed
jolly-bot: auto-format Lua files using Stylua
1 parent 914e743 commit 6804956

File tree

2 files changed

+4576
-4574
lines changed

2 files changed

+4576
-4574
lines changed

lib/misc.lua

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -183,39 +183,39 @@ end
183183

184184
-- simple plural s function for localisation
185185
function cry_pls(str, vars)
186-
local inside = str:match("<(.-)>") -- finds args
186+
local inside = str:match("<(.-)>") -- finds args
187187
local _table = {}
188188
if inside then
189-
for v in inside:gmatch("[^,]+") do -- adds args to array
189+
for v in inside:gmatch("[^,]+") do -- adds args to array
190190
table.insert(_table, v)
191191
end
192192
end
193-
local num = vars[tonumber(string.match(str, ">(%d+)"))] -- gets the number outside angle brackets, and its corresponding variable
194-
local plural = _table[1] -- default
195-
local checks = {[1] = "="}
193+
local num = vars[tonumber(string.match(str, ">(%d+)"))] -- gets the number outside angle brackets, and its corresponding variable
194+
local plural = _table[1] -- default
195+
local checks = { [1] = "=" }
196196
if #_table > 1 then
197197
for i = 2, #_table do
198198
local isnum = tonumber(_table[i])
199199
if isnum then
200-
checks[isnum] = ">"..(_table[i+1] or "")
200+
checks[isnum] = ">" .. (_table[i + 1] or "")
201201
i = i + 1
202202
elseif i == 2 then
203-
checks[1] = "=".._table[i]
203+
checks[1] = "=" .. _table[i]
204204
else
205-
print('Unexpected string: '.._table[i])
205+
print("Unexpected string: " .. _table[i])
206206
end
207207
end
208208
end
209209
local function fch(str, c)
210-
return string.sub(str, 1, 1) == c -- gets first char and returns boolean
210+
return string.sub(str, 1, 1) == c -- gets first char and returns boolean
211211
end
212212
for k, v in pairs(checks) do
213-
if fch(v, '=') then
213+
if fch(v, "=") then
214214
if math.abs(to_big(num) - k) < to_big(0.001) then
215215
return string.sub(v, 2, -1)
216216
end
217-
elseif fch(v, '>') then
218-
if to_big(num) >= to_big(k-0.001) then
217+
elseif fch(v, ">") then
218+
if to_big(num) >= to_big(k - 0.001) then
219219
return string.sub(v, 2, -1)
220220
end
221221
end
@@ -487,7 +487,7 @@ function save_cryptid()
487487
shinytags = {},
488488
}
489489
data.shinytags = copy_table(Cryptid.shinytagdata)
490-
compress_and_save( G.SETTINGS.profile..'/'..'cryptidsave.jkr', STR_PACK(data))
490+
compress_and_save(G.SETTINGS.profile .. "/" .. "cryptidsave.jkr", STR_PACK(data))
491491
end
492492

493493
local sppref = set_profile_progress

0 commit comments

Comments
 (0)