We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eb07941 commit 22c7829Copy full SHA for 22c7829
1 file changed
MCPForUnity/Editor/Tools/ManageScript.cs
@@ -1910,6 +1910,10 @@ private static bool TryComputeMethodSpan(
1910
int probe = lineStart - 1;
1911
while (probe > searchStart)
1912
{
1913
+ // Skip past line-ending chars so LastIndexOf finds the *previous* newline
1914
+ while (probe > searchStart && (source[probe] == '\n' || source[probe] == '\r'))
1915
+ probe--;
1916
+ if (probe <= searchStart) break;
1917
int prevNl = source.LastIndexOf('\n', probe);
1918
if (prevNl < 0 || prevNl < searchStart) break;
1919
string prev = source.Substring(prevNl + 1, attrStart - (prevNl + 1));
0 commit comments