Version 0.7.2-beta
- minimap button - graphical move arrows - crash on matches with 0-width
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
local _G = _G
|
||||
local Grichelde = _G.Grichelde
|
||||
|
||||
local nilOrEmpty, ipairs, spairs, tContains, tFilter, tInsert, tConcat, find, sub, isUpper, isLower, toUpper, toLower, trim, length
|
||||
= Grichelde.functions.nilOrEmpty, Grichelde.functions.ipairs, Grichelde.functions.spairs, Grichelde.functions.tContains, Grichelde.functions.tFilter, Grichelde.functions.tInsert, Grichelde.functions.tConcat,
|
||||
local IsAddOnLoaded, nilOrEmpty, ipairs, spairs, tContains, tFilter, tInsert, tConcat, find, sub, isUpper, isLower, toUpper, toLower, trim, length
|
||||
= Grichelde.functions.IsAddOnLoaded, Grichelde.functions.nilOrEmpty, Grichelde.functions.ipairs, Grichelde.functions.spairs, Grichelde.functions.tContains, Grichelde.functions.tFilter, Grichelde.functions.tInsert, Grichelde.functions.tConcat,
|
||||
Grichelde.functions.find, Grichelde.functions.sub, Grichelde.functions.isUpper, Grichelde.functions.isLower, Grichelde.functions.toUpper, Grichelde.functions.toLower, Grichelde.functions.trim, Grichelde.functions.length
|
||||
|
||||
--- Before a chat message is sent, check if replacement is required and replace the text accordingly.
|
||||
@@ -27,7 +27,7 @@ end
|
||||
function Grichelde:CheckAndReplace(message, type)
|
||||
local text = message
|
||||
if (self:CheckReplacement(text, type)) then
|
||||
if (_G.Misspelled) then
|
||||
if (IsAddOnLoaded("Misspelled")) then
|
||||
self:DebugPrint("Misspelled detected: cleansing message")
|
||||
text = _G.Misspelled:RemoveHighlighting(text)
|
||||
end
|
||||
@@ -218,7 +218,7 @@ function Grichelde:ReplaceCharacters(text)
|
||||
local oldResult = result
|
||||
|
||||
local pos1, pos2 = find(oldResult, search, pos)
|
||||
while (pos1 and pos2) do
|
||||
while (pos1 and pos2 and pos1 <= pos2) do
|
||||
self:TracePrint("pos1: %d, pos2: %d", pos1, pos2)
|
||||
local pre = sub(result, 1, pos1 - 1 + offset)
|
||||
local post = sub(result, pos2 + 1 + offset)
|
||||
@@ -247,7 +247,7 @@ function Grichelde:ReplaceCharacters(text)
|
||||
local lowerSearch = toLower(search)
|
||||
|
||||
local pos1, pos2 = find(lowerResult, lowerSearch, pos)
|
||||
while (pos1 and pos2) do
|
||||
while (pos1 and pos2 and pos1 <= pos2) do
|
||||
self:TracePrint("pos1: %d, pos2: %d", pos1, pos2)
|
||||
local pre = sub(result, 1, pos1 - 1 + offset)
|
||||
local match = sub(result, pos1 + offset, pos2 + offset)
|
||||
|
||||
Reference in New Issue
Block a user