Merge pull request #922 from pangeachat/730-fix-accept-replacement-2

730 fix accept replacement 2
pull/1476/head
ggurdin 1 year ago committed by GitHub
commit d2964e7986
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -141,8 +141,9 @@ class IGCTextData {
// start is inclusive
final startIndex = tokenIndexByOffset(pangeaMatch.match.offset);
// end is exclusive, hence the +1
// use pangeaMatch.matchContent.trim().length instead of pangeaMatch.match.length since pangeaMatch.match.length may include leading/trailing spaces
final endIndex = tokenIndexByOffset(
pangeaMatch.match.offset + pangeaMatch.match.length,
pangeaMatch.match.offset + pangeaMatch.matchContent.trim().length,
) +
1;
@ -159,7 +160,6 @@ class IGCTextData {
newTokens.replaceRange(startIndex, endIndex, replacement.tokens);
final String newFullText = PangeaToken.reconstructText(newTokens);
if (newFullText != originalInput && kDebugMode) {
PangeaToken.reconstructText(newTokens, debugWalkThrough: true);
ErrorHandler.logError(

Loading…
Cancel
Save