- restored previous changes; cleanup workspace

This commit is contained in:
2026-10-31 23:53:44 +01:00
parent 396e140102
commit ba160aface
13 changed files with 218 additions and 49 deletions
+8 -7
View File
@@ -1,9 +1,9 @@
-- import addon read namespace from global env
local _G = _G
local _G = _G or getfenv()
local Grichelde = _G.Grichelde or {}
local IsAddOnLoaded, assert, nilOrEmpty, pairs, ipairs, spairs, tContains, tFilter, tInsert, tIsEmpty, find, sub, gsub, getNextCharUtf8, isUtf8MultiByte, getUtf8Sequence, isUpper, isLower, toUpper, toLower, bytes2Char, trim, length, lengthUtf8
= Grichelde.F.IsAddOnLoaded, Grichelde.F.assert, Grichelde.F.nilOrEmpty, Grichelde.F.pairs, Grichelde.F.ipairs, Grichelde.F.spairs, Grichelde.F.tContains, Grichelde.F.tFilter, Grichelde.F.tInsert, Grichelde.F.tIsEmpty,
local IsAddOnLoaded, assert, nilOrEmpty, pairs, ipairs, spairs, tContains, tFilter, tInsert, tIsEmpty, tSize, find, sub, gsub, getNextCharUtf8, isUtf8MultiByte, getUtf8Sequence, isUpper, isLower, toUpper, toLower, bytes2Char, trim, length, lengthUtf8
= Grichelde.F.IsAddOnLoaded, Grichelde.F.assert, Grichelde.F.nilOrEmpty, Grichelde.F.pairs, Grichelde.F.ipairs, Grichelde.F.spairs, Grichelde.F.tContains, Grichelde.F.tFilter, Grichelde.F.tInsert, Grichelde.F.tIsEmpty, Grichelde.F.tSize,
Grichelde.F.find, Grichelde.F.sub, Grichelde.F.gsub, Grichelde.F.getNextCharUtf8, Grichelde.F.isUtf8MultiByte, Grichelde.F.getUtf8Sequence, Grichelde.F.isUpper, Grichelde.F.isLower, Grichelde.F.toUpper, Grichelde.F.toLower, Grichelde.F.bytes2Char, Grichelde.F.trim, Grichelde.F.length, Grichelde.F.lengthUtf8
--- Splits a long text in longest possible chunks of <= 255 length, split at last available space
@@ -142,7 +142,7 @@ end
function Grichelde:SendChunkifiedChatMessage(message, ...)
if (length(message) > 255) then
local chunks = self:SplitText(message)
self:DebugPrint("SendChunkifiedChatMessage : #chunks:", #chunks)
self:DebugPrint("SendChunkifiedChatMessage : #chunks:", tSize(chunks))
for _, chunk in ipairs(chunks) do
self.hooks["SendChatMessage"](chunk, ...);
@@ -218,9 +218,10 @@ function Grichelde:ReplaceCharacters(text, replName, replTable, consolidate, rep
local function replaceCaptures(txt, replaceText, captures)
local replText = replaceText
self:TracePrint("replaceCaptures : txt: %s, #captures: %d", txt, #captures)
local n = tSize(captures)
self:TracePrint("replaceCaptures : txt: %s, #captures: %d", txt, n)
if (#captures > 0) then
if (n > 0) then
for i, cap in ipairs(captures) do
--self:TracePrint("replaceCaptures : i: %d, cap: %s", i, cap)
if (cap == nil) then
@@ -875,7 +876,7 @@ function Grichelde:CheckAndExtractMessageTypeTarget(message)
local type = tFilter(self.SUPPORTED_CHAT_COMMANDS,
function(_, k, _) return chatCmd == k end
)
assert(#type < 2)
assert(tSize(type) < 2)
if (not tIsEmpty(type)) then
self:DebugPrint("CheckAndExtractMessageTypeTarget : determined type: %s", type[1])