diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2023-04-01 20:39:39 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2023-04-01 20:39:53 -0700 |
commit | 86517606a1fafcbff97b5646b74cd186a575cf68 (patch) | |
tree | e2b58e576c93dbfeea3668e74c0cf34a84b63a20 /source_file.lua | |
parent | c87e4a3babdc5fc0b338a549f17266783b4bdecd (diff) | |
download | lines.love-86517606a1fafcbff97b5646b74cd186a575cf68.tar.gz |
clean up some final bifold code
Diffstat (limited to 'source_file.lua')
-rw-r--r-- | source_file.lua | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/source_file.lua b/source_file.lua index 194ef9b..3adab1f 100644 --- a/source_file.lua +++ b/source_file.lua @@ -1,7 +1,5 @@ -- primitives for saving to file and loading from file -Fold = '\x1e' -- ASCII RS (record separator) - function file_exists(filename) local infile = App.open_for_reading(filename) if infile then @@ -28,13 +26,7 @@ function load_from_file(infile) if line == '```lines' then -- inflexible with whitespace since these files are always autogenerated table.insert(result, load_drawing(infile_next_line)) else - local line_info = {mode='text'} - if line:find(Fold) then - _, _, line_info.data, line_info.dataB = line:find('([^'..Fold..']*)'..Fold..'([^'..Fold..']*)') - else - line_info.data = line - end - table.insert(result, line_info) + table.insert(result, {mode='text', data=line}) end end end @@ -54,10 +46,6 @@ function save_to_disk(State) store_drawing(outfile, line) else outfile:write(line.data) - if line.dataB and #line.dataB > 0 then - outfile:write(Fold) - outfile:write(line.dataB) - end outfile:write('\n') end end @@ -147,11 +135,7 @@ function load_array(a) else --? print('inserting text') local line_info = {mode='text'} - if line:find(Fold) then - _, _, line_info.data, line_info.dataB = line:find('([^'..Fold..']*)'..Fold..'([^'..Fold..']*)') - else - line_info.data = line - end + line_info.data = line table.insert(result, line_info) end end |