From c1c32688a4afc43f6addb99b8b5fa878944a70e3 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 14 Jan 2019 15:42:48 -0800 Subject: Overhaul in progress, mostly working. Moved all the nomsu packages into lib/, including core/*. Changes to how nomsu environments and importing work. --- string2.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'string2.lua') diff --git a/string2.lua b/string2.lua index 09cb5ea..429ab7f 100644 --- a/string2.lua +++ b/string2.lua @@ -130,6 +130,12 @@ local string2 = { end return table.concat(lines, "\n") end, + indented = function(self, indent) + if indent == nil then + indent = " " + end + return indent .. (gsub(self, "\n", "\n" .. indent)) + end, as_lua = function(self) local escaped = gsub(self, "\\", "\\\\") escaped = gsub(escaped, "\n", "\\n") -- cgit v1.2.3