Skip to content

Commit 1113394

Browse files
VaporGamethegrb93
andauthored
Fix line highlighting bug and Fix opening ZCPU documentation (#72)
* Fix line highlighting bug and Fix opening ZCPU documentation * Update lua/wire/cpulib.lua Add failsafe for opening docs Co-authored-by: thegrb93 <[email protected]> --------- Co-authored-by: thegrb93 <[email protected]>
1 parent 72541c9 commit 1113394

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lua/wire/cpulib.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,11 @@ if CLIENT or TESTING then
372372
-- Update highlighted lines
373373
function CPULib.DebugUpdateHighlights(dontForcePosition)
374374
if ZCPU_Editor then
375+
-- Clear all highlighted lines
376+
for tab=1,ZCPU_Editor:GetNumTabs() do
377+
ZCPU_Editor:GetEditor(tab):ClearHighlightedLines()
378+
end
379+
375380
-- Highlight current position
376381
local currentPosition = CPULib.Debugger.PositionByPointer[CPULib.Debugger.Variables[CPULib.Debugger.PreferredTracker or "IP"]]
377382
if currentPosition then
@@ -380,10 +385,6 @@ if CLIENT or TESTING then
380385
if not currentPosition.File:sub(1,9):match("cpuchip/") then
381386
return
382387
end
383-
-- Clear all highlighted lines
384-
for tab=1,ZCPU_Editor:GetNumTabs() do
385-
ZCPU_Editor:GetEditor(tab):ClearHighlightedLines()
386-
end
387388

388389
local textEditor = CPULib.SelectTab(ZCPU_Editor,currentPosition.File,not CPULib.Debugger.FollowTracker)
389390
if textEditor then
@@ -464,6 +465,7 @@ if CLIENT or TESTING then
464465
CPULib.HandbookWindow = nil
465466
-- Platform bookmarks, it'll automatically jump to this section when opening.
466467
local bookmarks = {
468+
ZCPU="",
467469
ZGPU="#zgpu",
468470
ZSPU="#zspu"
469471
}
@@ -480,7 +482,7 @@ if CLIENT or TESTING then
480482
browser:SetPos(10, 25)
481483
browser:SetSize(w - 20, h - 35)
482484

483-
browser:OpenURL("https://wiremod.github.io/Miscellaneous/zcpudoc.html"..bookmarks[bookmark] or "")
485+
browser:OpenURL("https://wiremod.github.io/Miscellaneous/zcpudoc.html"..(bookmarks[bookmark] or ""))
484486
end
485487
end
486488

0 commit comments

Comments
 (0)