diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-07-17 21:05:01 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-07-17 21:05:01 -0700 |
commit | 29dac6a6eccf5e5f09debe789fb4f314e460088b (patch) | |
tree | e9c7d252374c0c3b1ad6130a07875280d1f6d47e /main.lua | |
parent | 64eed749809a4412a6663d149cd57a41431df91d (diff) | |
download | text.love-29dac6a6eccf5e5f09debe789fb4f314e460088b.tar.gz |
separate data structure for each line's cache data
I have no idea what the performance implications of this are..
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/main.lua b/main.lua index 11bf3db..6c5dc9c 100644 --- a/main.lua +++ b/main.lua @@ -39,6 +39,7 @@ function App.initialize(arg) if #arg > 0 then Editor_state.filename = arg[1] Editor_state.lines = load_from_disk(Editor_state.filename) + Text.redraw_all(Editor_state) Editor_state.screen_top1 = {line=1, pos=1} Editor_state.cursor1 = {line=1, pos=1} for i,line in ipairs(Editor_state.lines) do @@ -49,6 +50,7 @@ function App.initialize(arg) end else Editor_state.lines = load_from_disk(Editor_state.filename) + Text.redraw_all(Editor_state) if Editor_state.cursor1.line > #Editor_state.lines or Editor_state.lines[Editor_state.cursor1.line].mode ~= 'text' then for i,line in ipairs(Editor_state.lines) do if line.mode == 'text' then |