# HG changeset patch # User Matthew Wild # Date 1332435099 0 # Node ID e00b4ec5fca413af545cdcbcb3388a23d0a6dffe # Parent 816c319a09d8436569717f31a6049b64673b2905 util.debug: Move boundary markers to top of relevant sections of the stack trace (easier to follow) diff -r 816c319a09d8 -r e00b4ec5fca4 util/debug.lua --- a/util/debug.lua Thu Mar 22 16:39:28 2012 +0000 +++ b/util/debug.lua Thu Mar 22 16:51:39 2012 +0000 @@ -113,7 +113,7 @@ local function build_source_boundary_marker(last_source_desc) local padding = string.rep("-", math.floor(((optimal_line_length - 6) - #last_source_desc)/2)); - return getstring(styles.boundary_padding, "^"..padding).." "..getstring(styles.filename, last_source_desc).." "..getstring(styles.boundary_padding, padding..(#last_source_desc%2==0 and "-^" or "^ ")); + return getstring(styles.boundary_padding, "v"..padding).." "..getstring(styles.filename, last_source_desc).." "..getstring(styles.boundary_padding, padding..(#last_source_desc%2==0 and "-v" or "v ")); end function debug._traceback(thread, message, level) @@ -158,10 +158,8 @@ line = "[Lua] "..getstring(styles.location, info.short_src.." line "..info.currentline).." in "..func_type..getstring(styles.funcname, name).." (defined on line "..info.linedefined..")"; end if source_desc ~= last_source_desc then -- Venturing into a new source, add marker for previous - if last_source_desc then - table.insert(lines, "\t "..build_source_boundary_marker(last_source_desc)); - end last_source_desc = source_desc; + table.insert(lines, "\t "..build_source_boundary_marker(last_source_desc)); end nlevel = nlevel-1; table.insert(lines, "\t"..(nlevel==0 and ">" or " ")..getstring(styles.level_num, "("..nlevel..") ")..line); @@ -176,7 +174,7 @@ end end - table.insert(lines, "\t "..build_source_boundary_marker(last_source_desc)); +-- table.insert(lines, "\t "..build_source_boundary_marker(last_source_desc)); return message.."stack traceback:\n"..table.concat(lines, "\n"); end