about summary refs log tree commit diff stats
path: root/text.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-03-26 09:36:41 -0700
committerKartik K. Agaram <vc@akkartik.com>2023-03-26 09:36:41 -0700
commiteae5c9505c665b343af7690d9665431ae17ed5e9 (patch)
tree046b87f9af87ff6510e3fed2076032593a36dd24 /text.lua
parent0ae94b0de59618bb86a55edcaa8e961abb192f2d (diff)
downloadtext.love-eae5c9505c665b343af7690d9665431ae17ed5e9.tar.gz
bugfix: naming points
Diffstat (limited to 'text.lua')
-rw-r--r--text.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/text.lua b/text.lua
index 35b30c4..589e4fd 100644
--- a/text.lua
+++ b/text.lua
@@ -161,6 +161,7 @@ function Text.text_input(State, t)
 end
 
 function Text.insert_at_cursor(State, t)
+  assert(State.lines[State.cursor1.line].mode == 'text')
   local byte_offset = Text.offset(State.lines[State.cursor1.line].data, State.cursor1.pos)
   State.lines[State.cursor1.line].data = string.sub(State.lines[State.cursor1.line].data, 1, byte_offset-1)..t..string.sub(State.lines[State.cursor1.line].data, byte_offset)
   Text.clear_screen_line_cache(State, State.cursor1.line)