diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-08-14 08:10:24 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-08-14 08:10:24 -0700 |
commit | 9459d91abc6ff8246536b23c66215e0ff09f87bb (patch) | |
tree | 0fc6e899814842c7a8f18d085de40e21ee0017e9 /edit.lua | |
parent | 4d1e7f922db04e1d57d5604ec604b974c922cbf8 (diff) | |
download | text.love-9459d91abc6ff8246536b23c66215e0ff09f87bb.tar.gz |
remove some duplication
Diffstat (limited to 'edit.lua')
-rw-r--r-- | edit.lua | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/edit.lua b/edit.lua index efc6f71..ccf675b 100644 --- a/edit.lua +++ b/edit.lua @@ -119,12 +119,10 @@ function edit.initialize_state(top, left, right, font_height, line_height) -- c end -- App.initialize_state function edit.fixup_cursor(State) - if State.cursor1.line > #State.lines or State.lines[State.cursor1.line].mode ~= 'text' then - for i,line in ipairs(State.lines) do - if line.mode == 'text' then - State.cursor1.line = i - break - end + for i,line in ipairs(State.lines) do + if line.mode == 'text' then + State.cursor1.line = i + break end end end |