Skip to content

Commit 9fa7d98

Browse files
committed
change(web): improve split input-segment source merge code
1 parent 2cc3901 commit 9fa7d98

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

web/src/engine/predictive-text/worker-thread/src/main/correction/search-quotient-spur.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,12 @@ export abstract class SearchQuotientSpur implements SearchQuotientNode {
359359
if(this.inputSource) {
360360
const inputId = this.inputSource.segment.transitionId;
361361
if(inputId && parentSources.length > 0 && parentSources[parentSources.length - 1].segment.transitionId == inputId) {
362+
// Fuse the input sources!
363+
const tailSrc = parentSources[parentSources.length - 1];
364+
tailSrc.segment.end = this.inputSource.segment.end;
365+
if(tailSrc.segment.end) {
366+
delete tailSrc.segment.end;
367+
}
362368
return parentSources;
363369
}
364370

0 commit comments

Comments
 (0)