Skip to content

Commit 64a3aa5

Browse files
Fix Off-by-one in index mapping when consecutive Chinese chars
Found by code rabbit
1 parent 4b6231b commit 64a3aa5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Flow.Launcher.Infrastructure/PinyinAlphabet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ public bool ShouldTranslate(string stringToTranslate)
107107
string translated = _settings.UseDoublePinyin ? ToDoublePin(resultList[i]) : resultList[i];
108108
if (previousIsChinese)
109109
{
110-
map.AddNewIndex(i, resultBuilder.Length, translated.Length + 1);
111110
resultBuilder.Append(' ');
111+
map.AddNewIndex(i, resultBuilder.Length, translated.Length + 1);
112112
resultBuilder.Append(translated);
113113
}
114114
else

0 commit comments

Comments
 (0)