@@ -108,7 +108,7 @@ blobsProfiler.viewPropertiesPopup = function(title, data, width, height)
108108 return propertiesFrame
109109end
110110
111- blobsProfiler .generateAceEditorPanel = function (parentPanel , content , editorMode , readOnly )
111+ blobsProfiler .generateAceEditorPanel = function (parentPanel , content , editorMode , readOnly , startLine )
112112 local dhtmlPanel = vgui .Create (" DHTML" , parentPanel )
113113 content = content or [[ print("Hello world!")]]
114114 editorMode = editorMode or " Lua"
@@ -143,7 +143,8 @@ blobsProfiler.generateAceEditorPanel = function(parentPanel, content, editorMode
143143 editor.setOptions({
144144 showLineNumbers: true,
145145 tabSize: 2,
146- readOnly: ]] .. tostring (tobool (readOnly )) --[[ really? ]] .. [[
146+ readOnly: ]] .. tostring (tobool (readOnly )) --[[ really? ]] .. [[ ,
147+ firstLineNumber: ]] .. (startLine or 1 ).. [[
147148 });
148149
149150 function getEditorValue() {
@@ -175,7 +176,11 @@ local function popupSourceView(sourceContent, frameTitle)
175176 sourceFrame :Center ()
176177 sourceFrame :MakePopup ()
177178
178- local sourcePanel = blobsProfiler .generateAceEditorPanel (sourceFrame , sourceContent , " Lua" , true )
179+ local startLine , endLine = frameTitle :match (" Lines%: (%d+)%-(%d+)" )
180+ startLine = tonumber (startLine )
181+ endLine = tonumber (endLine )
182+
183+ local sourcePanel = blobsProfiler .generateAceEditorPanel (sourceFrame , sourceContent , " Lua" , true , startLine )
179184 sourcePanel :Dock (FILL )
180185
181186 sourcePanel .OnRemove = function ()
@@ -228,8 +233,8 @@ net.Receive("blobsProfiler:sendSourceChunk", function()
228233 end
229234
230235 if allChunksReceived then
231- local splitRequest = string .Explode (" :" , requestId )
232- popupSourceView (combinedSource , splitRequest [ 1 ] )
236+ -- local splitRequest = string.Explode(":", requestId)
237+ popupSourceView (combinedSource , requestId )
233238
234239 receivedSource [requestId ] = nil -- Clean up the request data
235240 end
0 commit comments