Skip to content

Commit ca7fa59

Browse files
Update packages/core/src/tools/edit.ts
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 8f125c6 commit ca7fa59

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/core/src/tools/edit.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,11 @@ class EditToolInvocation
842842
const newlineIdx = normalized.indexOf('\n');
843843
const firstLine =
844844
newlineIdx !== -1 ? normalized.substring(0, newlineIdx) : normalized;
845-
const chars = Array.from(firstLine);
845+
const chars = [];
846+
for (const segment of new Intl.Segmenter().segment(firstLine)) {
847+
chars.push(segment.segment);
848+
if (chars.length >= 30) break;
849+
}
846850
if (chars.length > 30) {
847851
return chars.slice(0, 30).join('') + '...';
848852
}

0 commit comments

Comments
 (0)