diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-01-14 15:42:48 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-01-14 15:43:24 -0800 |
| commit | c1c32688a4afc43f6addb99b8b5fa878944a70e3 (patch) | |
| tree | c886f21b5b08a9053aa74fcba4b241dae5ede76d /string2.lua | |
| parent | 2309b696fc34b24f05f6658b94f9105ca8ee76e4 (diff) | |
Overhaul in progress, mostly working. Moved all the nomsu packages into
lib/, including core/*. Changes to how nomsu environments and importing
work.
Diffstat (limited to 'string2.lua')
| -rw-r--r-- | string2.lua | 6 |
1 files changed, 6 insertions, 0 deletions
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") |
