UTF73CBLAPLW2J6BUF4Q7N2TETQ2IKSUZ4267UG357V4SFXDFUTAC
7Q4B6M2DAB6FZX6RGA2ZX2UTP6PG2LC745WNPK7ZMEUCSSGXEUQQC
VVXVV2D2F5Y6D6N5VVPUPK3N6GMDTG2YCYPQDYTYEKVKBYHRRYEAC
6LJZN727CRPYR34LV75CQF55YZI3E7MGESYZSFSYAE73SNEZE3FAC
OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC
3CS5KKCIZQ6J4SBILINYZSOM6V3U2LE7YIXOZVKXXNBROF6Z6JWAC
IYW7X3WLOPYLSNO5IQNSULUNO4XFEM24DJ2VB5HPBUKWUYFPRCGQC
6PUNJS5BSLTYMYMN4JFD7YDEGVQLM5PGAT7PQIG5NIAKLTM5T4PQC
elseif chord == 'delete' then
if cursor_pos <= #lines[cursor_line].data then
local byte_start = utf8.offset(lines[cursor_line].data, cursor_pos)
local byte_end = utf8.offset(lines[cursor_line].data, cursor_pos+1)
if byte_start then
if byte_end then
lines[cursor_line].data = string.sub(lines[cursor_line].data, 1, byte_start-1)..string.sub(lines[cursor_line].data, byte_end)
else
lines[cursor_line].data = string.sub(lines[cursor_line].data, 1, byte_start-1)
end
-- no change to cursor_pos
end
end
-- transitioning between drawings and text
elseif chord == 'delete' then
if cursor_pos <= #lines[cursor_line].data then
local byte_start = utf8.offset(lines[cursor_line].data, cursor_pos)
local byte_end = utf8.offset(lines[cursor_line].data, cursor_pos+1)
if byte_start then
if byte_end then
lines[cursor_line].data = string.sub(lines[cursor_line].data, 1, byte_start-1)..string.sub(lines[cursor_line].data, byte_end)
else
lines[cursor_line].data = string.sub(lines[cursor_line].data, 1, byte_start-1)
end
-- no change to cursor_pos
end
end
-- shortcuts for drawings