about summary refs log tree commit diff stats
path: root/source_text.lua
diff options
context:
space:
mode:
Diffstat (limited to 'source_text.lua')
-rw-r--r--source_text.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/source_text.lua b/source_text.lua
index fb4c389..4d13748 100644
--- a/source_text.lua
+++ b/source_text.lua
@@ -178,6 +178,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)