@@ -108,7 +108,7 @@ blobsProfiler.viewPropertiesPopup = function(title, data, width, height)
108
108
return propertiesFrame
109
109
end
110
110
111
- blobsProfiler .generateAceEditorPanel = function (parentPanel , content , editorMode , readOnly )
111
+ blobsProfiler .generateAceEditorPanel = function (parentPanel , content , editorMode , readOnly , startLine )
112
112
local dhtmlPanel = vgui .Create (" DHTML" , parentPanel )
113
113
content = content or [[ print("Hello world!")]]
114
114
editorMode = editorMode or " Lua"
@@ -143,7 +143,8 @@ blobsProfiler.generateAceEditorPanel = function(parentPanel, content, editorMode
143
143
editor.setOptions({
144
144
showLineNumbers: true,
145
145
tabSize: 2,
146
- readOnly: ]] .. tostring (tobool (readOnly )) --[[ really? ]] .. [[
146
+ readOnly: ]] .. tostring (tobool (readOnly )) --[[ really? ]] .. [[ ,
147
+ firstLineNumber: ]] .. (startLine or 1 ).. [[
147
148
});
148
149
149
150
function getEditorValue() {
@@ -175,7 +176,11 @@ local function popupSourceView(sourceContent, frameTitle)
175
176
sourceFrame :Center ()
176
177
sourceFrame :MakePopup ()
177
178
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 )
179
184
sourcePanel :Dock (FILL )
180
185
181
186
sourcePanel .OnRemove = function ()
@@ -228,8 +233,8 @@ net.Receive("blobsProfiler:sendSourceChunk", function()
228
233
end
229
234
230
235
if allChunksReceived then
231
- local splitRequest = string .Explode (" :" , requestId )
232
- popupSourceView (combinedSource , splitRequest [ 1 ] )
236
+ -- local splitRequest = string.Explode(":", requestId)
237
+ popupSourceView (combinedSource , requestId )
233
238
234
239
receivedSource [requestId ] = nil -- Clean up the request data
235
240
end
0 commit comments