Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions UnityMcpBridge/Editor/Tools/ManageScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ private static object ApplyTextEdits(

// Convert edits to absolute index ranges
var spans = new List<(int start, int end, string text)>();
int totalBytes = 0;
long totalBytes = 0;
foreach (var e in edits)
{
try
Expand All @@ -483,7 +483,10 @@ private static object ApplyTextEdits(
if (eidx < sidx) (sidx, eidx) = (eidx, sidx);

spans.Add((sidx, eidx, newText));
totalBytes += System.Text.Encoding.UTF8.GetByteCount(newText);
checked
{
totalBytes += System.Text.Encoding.UTF8.GetByteCount(newText);
}
}
catch (Exception ex)
{
Expand Down