From 6a057b6b5605f5965ebdc511d648840206ce9015 Mon Sep 17 00:00:00 2001 From: leaf corcoran Date: Tue, 29 Sep 2015 02:17:40 -0700 Subject: [PATCH] show preview of buffer on non-terminal debugger --- moonscript/parse/env.lua | 5 +++-- moonscript/parse/env.moon | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/moonscript/parse/env.lua b/moonscript/parse/env.lua index 6dbed84..f805211 100644 --- a/moonscript/parse/env.lua +++ b/moonscript/parse/env.lua @@ -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, ...) diff --git a/moonscript/parse/env.moon b/moonscript/parse/env.moon index 25dcc1e..ea71c3d 100644 --- a/moonscript/parse/env.moon +++ b/moonscript/parse/env.moon @@ -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, ...) ->