Fix bug when trying to delete a char of an empty string

This commit is contained in:
Matthias Richter 2016-01-02 15:35:31 +01:00
parent 2ae96a5950
commit 1f0c54afc7

View file

@ -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