Merge pull request #922 from pangeachat/730-fix-accept-replacement-2
730 fix accept replacement 2
This commit is contained in:
commit
d2964e7986
1 changed files with 2 additions and 2 deletions
|
|
@ -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…
Add table
Reference in a new issue