"[chore] migrate lua code to be compatible with 5.5 syntax.

This commit is contained in:
2026-05-09 01:31:32 +08:00
parent 90bdf8464d
commit dab0f20851
4 changed files with 12 additions and 10 deletions

View File

@@ -7,11 +7,12 @@ local F = {}
function F.func( input, env )
local latest_text = env.engine.context.commit_history:latest_text()
for cand in input:iter() do
local cand_ = cand
if cand.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 )
cand_ = cand:to_shadow_candidate( 'en_spacer', cand.text:gsub( '(%a+\'?%a*)', ' %1' ), cand.comment )
end
yield( cand )
yield( cand_ )
end
end