Commits

Chris Klimas  committed 2e172ba

Sourced print shows exact line where available

  • Participants
  • Parent commits 30fabb3

Comments (0)

Files changed (1)

File zoetrope/debug/console.lua

 		self._oldPrint = print
 
 		print = function (...)
-			local caller = debug.getinfo(2)
+			local caller = debug.getinfo(2, 'Sl')
 
 			if caller.linedefined ~= 0 then
-				self.log.text = self.log.text .. '(' .. caller.short_src .. ':' .. caller.linedefined .. ') '
+				self.log.text = self.log.text .. '(' .. caller.short_src .. ':' .. (caller.currentline or caller.linedefined) .. ') '
 			end
 
 			for _, value in pairs{...} do