about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-08-18 13:48:33 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-08-18 13:48:33 -0700
commit0c7bc1812da4d77392db4675dfbe0f87d0794d70 (patch)
tree892f894cbb43b7aaf4e73603fcfaf0aa565af96d
parent61b59f4dd6446d87ef4a90d3d562b53c8fc8f75c (diff)
parentdd15f15640b882f7080ef3275b6a8c132bd1371d (diff)
downloadtext.love-0c7bc1812da4d77392db4675dfbe0f87d0794d70.tar.gz
Merge lines.love
-rw-r--r--text.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/text.lua b/text.lua
index 905ce53..377efb3 100644
--- a/text.lua
+++ b/text.lua
@@ -433,7 +433,7 @@ function Text.up(State)
   else
     -- move up one screen line in current line
     assert(screen_line_index > 1)
-    new_screen_line_starting_pos = State.line_cache[State.cursor1.line].screen_line_starting_pos[screen_line_index-1]
+    local new_screen_line_starting_pos = State.line_cache[State.cursor1.line].screen_line_starting_pos[screen_line_index-1]
     local new_screen_line_starting_byte_offset = Text.offset(State.lines[State.cursor1.line].data, new_screen_line_starting_pos)
     local s = string.sub(State.lines[State.cursor1.line].data, new_screen_line_starting_byte_offset)
     State.cursor1.pos = new_screen_line_starting_pos + Text.nearest_cursor_pos(s, State.cursor_x, State.left) - 1
@@ -468,7 +468,7 @@ function Text.down(State)
     local scroll_down = Text.le1(State.screen_bottom1, State.cursor1)
 --?     print('cursor is NOT at final screen line of its line')
     local screen_line_starting_pos, screen_line_index = Text.pos_at_start_of_screen_line(State, State.cursor1)
-    new_screen_line_starting_pos = State.line_cache[State.cursor1.line].screen_line_starting_pos[screen_line_index+1]
+    local new_screen_line_starting_pos = State.line_cache[State.cursor1.line].screen_line_starting_pos[screen_line_index+1]
 --?     print('switching pos of screen line at cursor from '..tostring(screen_line_starting_pos)..' to '..tostring(new_screen_line_starting_pos))
     local new_screen_line_starting_byte_offset = Text.offset(State.lines[State.cursor1.line].data, new_screen_line_starting_pos)
     local s = string.sub(State.lines[State.cursor1.line].data, new_screen_line_starting_byte_offset)