Skip to content

Commit

Permalink
Don't try to update highlights in wrong editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
DerelictDrone committed Sep 10, 2024
1 parent a303554 commit b29f8fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/wire/cpulib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,12 @@ if CLIENT or TESTING then
if ZCPU_Editor then
-- Highlight current position
local currentPosition = CPULib.Debugger.PositionByPointer[CPULib.Debugger.Variables[CPULib.Debugger.PreferredTracker or "IP"]]

if currentPosition then
-- Check if currentposition is even in the correct editor first, when switching editors CPULib's debugging info switches
-- to the file in the new editor.
if not currentPosition.File:sub(1,9):match("cpuchip/") then
return
end
-- Clear all highlighted lines
for tab=1,ZCPU_Editor:GetNumTabs() do
ZCPU_Editor:GetEditor(tab):ClearHighlightedLines()
Expand Down

0 comments on commit b29f8fd

Please sign in to comment.