Fix Off-by-one in index mapping when consecutive Chinese chars

Found by code rabbit
This commit is contained in:
VictoriousRaptor 2025-06-19 19:29:50 +08:00
parent 4b6231ba8b
commit 64a3aa583f

View file

@ -107,8 +107,8 @@ namespace Flow.Launcher.Infrastructure
string translated = _settings.UseDoublePinyin ? ToDoublePin(resultList[i]) : resultList[i];
if (previousIsChinese)
{
map.AddNewIndex(i, resultBuilder.Length, translated.Length + 1);
resultBuilder.Append(' ');
map.AddNewIndex(i, resultBuilder.Length, translated.Length + 1);
resultBuilder.Append(translated);
}
else