about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2025-01-22 15:53:09 -0800
committerKartik K. Agaram <vc@akkartik.com>2025-01-22 15:53:09 -0800
commit1a0baa7cecd9904c69eb2f1bf9ef6bf87ff19aa3 (patch)
tree4eeb69008b1fbe685b5564de5689a24f08720dde
parent97aa8b77e631ab6b33a7c46d448634d3fafb49fd (diff)
parent3b4df38732ee66b20e481ea683a64cf4e9f4f500 (diff)
downloadview.love-main.tar.gz
Merge text.love HEAD main
-rw-r--r--source_edit.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/source_edit.lua b/source_edit.lua
index a8dd682..91bcb58 100644
--- a/source_edit.lua
+++ b/source_edit.lua
@@ -143,13 +143,13 @@ end
 
 function edit.put_cursor_on_next_text_line(State)
   local line = State.cursor1.line
-  while line < #State.lines do
+  if State.lines[line].mode == 'text' then return end
+  while line <= #State.lines and State.lines[line].mode ~= 'text' do
     line = line+1
-    if State.lines[line].mode == 'text' then
-      State.cursor1.line = line
-      State.cursor1.pos = 1
-      break
-    end
+  end
+  if line <= #State.lines and State.lines[line].mode == 'text' then
+    State.cursor1.line = line
+    State.cursor1.pos = 1
   end
 end