mirror of
https://github.com/iDvel/rime-ice.git
synced 2026-05-14 00:30:37 +08:00
fix(lua): avoid assigning to const for-loop variable for Lua 5.5 compat (#1517)
follow 18cb213d9f
This commit is contained in:
@@ -6,11 +6,12 @@ local F = {}
|
||||
function F.func( input, env )
|
||||
local latest_text = env.engine.context.commit_history:latest_text()
|
||||
for cand in input:iter() do
|
||||
if cand.text:match( '^[%a\']+[%a\']*$' ) and latest_text and #latest_text > 0 and
|
||||
local c = cand
|
||||
if c.text:match( '^[%a\']+[%a\']*$' ) and latest_text and #latest_text > 0 and
|
||||
latest_text:find( '^ ?[%a\']+[%a\']*$' ) then
|
||||
cand = cand:to_shadow_candidate( 'en_spacer', cand.text:gsub( '(%a+\'?%a*)', ' %1' ), cand.comment )
|
||||
c = c:to_shadow_candidate( 'en_spacer', c.text:gsub( '(%a+\'?%a*)', ' %1' ), c.comment )
|
||||
end
|
||||
yield( cand )
|
||||
yield( c )
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user