show preview of buffer on non-terminal debugger

This commit is contained in:
leaf corcoran 2015-09-29 02:17:40 -07:00
parent 8db1006916
commit 6a057b6b56
2 changed files with 7 additions and 4 deletions

View File

@ -34,8 +34,9 @@ wrap_env = function(debug, fn)
end
wrap_name = function(name)
local v = V(name)
v = Cmt("", function()
iprint("* " .. name)
v = Cmt("", function(str, pos)
local rest = str:sub(pos, -1):match("^([^\n]*)")
iprint("* " .. tostring(name) .. " (" .. tostring(rest) .. ")")
indent = indent + 1
return true
end) * Cmt(v, function(str, pos, ...)

View File

@ -18,8 +18,10 @@ wrap_env = (debug, fn) ->
wrap_name = (name) ->
v = V name
v = Cmt("", ->
iprint "* " .. name
v = Cmt("", (str, pos) ->
rest = str\sub(pos, -1)\match "^([^\n]*)"
iprint "* #{name} (#{rest})"
indent += 1
true
) * Cmt(v, (str, pos, ...) ->