fix: fix youdao input key calculate mistake (unicode uncode)

This commit is contained in:
JuanZoran
2023-03-16 16:07:44 +08:00
parent 020876d8c4
commit 870be41bee
7 changed files with 91 additions and 91 deletions

View File

@ -93,6 +93,14 @@ function M:init_window(opts)
return self.window
end
---Get Formatted icon text
---@param format string format string
---@return string formatted text
---@return integer _ replaced count
function M:icon_format(format)
return format:gsub('{{(%w+)}}', self.opts.icon, 1)
end
---Get Check function for waiting
---@return function
function M:wait()
@ -131,9 +139,10 @@ function M:fallback()
local buffer = self.buffer
local opts = self.opts
buffer:wipe()
local fallback_msg = opts.fallback_message:gsub('{{(%w+)}}', opts.icon)
local opts = self.opts
local fallback_msg = self:icon_format(opts.fallback_message)
-- TODO :Center
buffer[1] = Trans.util.center(fallback_msg, opts.width)