diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-07-03 21:03:52 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-07-03 21:03:52 -0700 |
commit | ea40a9b661e09ec6d4e74ac277ea785823ff03f0 (patch) | |
tree | 2852616824167c72f444e730e64f19bd354f79dd | |
parent | 826207a54aabc4c2e77d2230ae9d846e50a9cb1e (diff) | |
download | view.love-ea40a9b661e09ec6d4e74ac277ea785823ff03f0.tar.gz |
bugfix
Gracefully degrade if previously edited file shrinks.
-rw-r--r-- | main.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main.lua b/main.lua index 17a19e5..4f6fd00 100644 --- a/main.lua +++ b/main.lua @@ -128,7 +128,7 @@ function App.initialize(arg) end else Lines = load_from_disk(Filename) - if Lines[Cursor1.line].mode ~= 'text' then + if Cursor1.line > #Lines or Lines[Cursor1.line].mode ~= 'text' then for i,line in ipairs(Lines) do if line.mode == 'text' then Cursor1.line = i |