diff --git a/LuaProfiler/Tools/InjectLua.exe b/LuaProfiler/Tools/InjectLua.exe index e946416d..8c4c810c 100644 Binary files a/LuaProfiler/Tools/InjectLua.exe and b/LuaProfiler/Tools/InjectLua.exe differ diff --git a/LuaProfiler/Tools/InjectLua/InjectLua/Parse/Parse.cs b/LuaProfiler/Tools/InjectLua/InjectLua/Parse/Parse.cs index 76201445..990f09a1 100644 --- a/LuaProfiler/Tools/InjectLua/InjectLua/Parse/Parse.cs +++ b/LuaProfiler/Tools/InjectLua/InjectLua/Parse/Parse.cs @@ -187,6 +187,11 @@ static void InsertSample(LLex l, ref int lastPos, ref int nextPos, int tokenType case (int)TK.RETURN: int insertPos = lastPos - 1; + if (lastStackToken == (int)TK.FUNCTION && tokens.Count == 1) + { + hasReturn = true; + } + if (tokens.Count == 0) { needLastSample = false; @@ -239,11 +244,6 @@ static void InsertSample(LLex l, ref int lastPos, ref int nextPos, int tokenType break; } } - - if (lastStackToken != (int)TK.IF) - { - hasReturn = true; - } break; case (int)TK.END: if (tokens.Count > 0) diff --git a/LuaProfiler/example/Assets/LuaProfiler/Core/Driver/Parse/Parse.cs b/LuaProfiler/example/Assets/LuaProfiler/Core/Driver/Parse/Parse.cs index 76201445..990f09a1 100644 --- a/LuaProfiler/example/Assets/LuaProfiler/Core/Driver/Parse/Parse.cs +++ b/LuaProfiler/example/Assets/LuaProfiler/Core/Driver/Parse/Parse.cs @@ -187,6 +187,11 @@ static void InsertSample(LLex l, ref int lastPos, ref int nextPos, int tokenType case (int)TK.RETURN: int insertPos = lastPos - 1; + if (lastStackToken == (int)TK.FUNCTION && tokens.Count == 1) + { + hasReturn = true; + } + if (tokens.Count == 0) { needLastSample = false; @@ -239,11 +244,6 @@ static void InsertSample(LLex l, ref int lastPos, ref int nextPos, int tokenType break; } } - - if (lastStackToken != (int)TK.IF) - { - hasReturn = true; - } break; case (int)TK.END: if (tokens.Count > 0) diff --git a/LuaProfiler/example/Assets/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerTreeView.cs b/LuaProfiler/example/Assets/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerTreeView.cs index 4473c8bc..5228f968 100644 --- a/LuaProfiler/example/Assets/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerTreeView.cs +++ b/LuaProfiler/example/Assets/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerTreeView.cs @@ -441,6 +441,8 @@ public LuaProfilerTreeView(TreeViewState treeViewState, float width) //NetWorkClient.ConnectServer("127.0.0.1", 23333); //LuaProfiler.SetSampleEnd(LoadRootSample); + showAlternatingRowBackgrounds = true; + showBorder = true; m_root = LuaProfilerTreeViewItem.Create(null, -1, null); needRebuild = true; multiColumnHeader.sortingChanged += (header) => { needRebuild = true; };