@move_cursor [@cursor[0], @cursor[1] - 1]
return false
when KEY_DELETE
+ return false unless @cursor?
+ return false unless @cursor[1] < @cursor[0].text.length
+ @cursor[0].text = @cursor[0].text.substr(0, @cursor[1]) + @cursor[0].text.substr(@cursor[1] + 1)
+ @cursor[0].el.nodeValue = @cursor[0].text
+ @move_cursor [@cursor[0], @cursor[1]]
return false
when KEY_ENTER
return false
@clear_dom()
instantiate_tree @tree, @idoc.body
move_cursor: (cursor) ->
- return if @cursor? and cursor? and @cursor[0] is cursor[0] and @cursor[1] is cursor[1]
@cursor = cursor
# replace cursor, to reset blink animation
if @cursor_visible