Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Classes/EditControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ local EditClass = newClass("EditControl", "ControlHost", "Control", "UndoHandler
self.TooltipHost()
self:SetText(init or "")
self.prompt = prompt
self.filter = filter or "^%w%p "
self.filter = filter or (main.unicode and "%c" or "^%w%p ")
self.filterPattern = "["..self.filter.."]"
self.limit = limit
self.changeFunc = changeFunc
Expand Down
10 changes: 10 additions & 0 deletions src/Modules/Main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ local tempTable2 = { }
main = new("ControlHost")

function main:Init()
self:DetectUnicodeSupport()
self.modes = { }
self.modes["LIST"] = LoadModule("Modules/BuildList")
self.modes["BUILD"] = LoadModule("Modules/Build")
Expand Down Expand Up @@ -255,6 +256,15 @@ the "Releases" section of the GitHub page.]])
end
end

function main:DetectUnicodeSupport()
-- In PoeCharm returns a valid width, in normal PoB returns 2142240768
local w = DrawStringWidth(16, "VAR", "\195\164") -- U+00E4 LATIN SMALL LETTER A WITH DIAERESIS
self.unicode = w > 0 and w < 100
if self.unicode then
ConPrintf("Unicode support detected")
end
end

function main:SaveModCache()
-- Update mod cache
local out = io.open("Data/ModCache.lua", "w")
Expand Down