From 1f0c54afc733a85483e4d79cbe9474e8f39f0ef1 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Sat, 2 Jan 2016 15:35:31 +0100 Subject: [PATCH] Fix bug when trying to delete a char of an empty string --- input.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input.lua b/input.lua index 9cbcabe..b52f33e 100644 --- a/input.lua +++ b/input.lua @@ -5,7 +5,7 @@ local core = require(BASE .. 'core') local utf8 = require 'utf8' local function split(str, pos) - local offset = utf8.offset(str, pos) + local offset = utf8.offset(str, pos) or 0 return str:sub(1, offset-1), str:sub(offset) end