From: Jason Woofenden Date: Fri, 8 Apr 2016 16:11:10 +0000 (-0400) Subject: fix @insert_character: don't assume at cursor X-Git-Url: https://jasonwoof.com/gitweb/?p=peach-html5-editor.git;a=commitdiff_plain;h=887afa2c256c214ae5c3b9583a980c842121e912 fix @insert_character: don't assume at cursor --- diff --git a/editor.coffee b/editor.coffee index 9f6d8eb..60ea832 100644 --- a/editor.coffee +++ b/editor.coffee @@ -1378,8 +1378,7 @@ class PeachHTML5Editor return false # after calling this, you MUST call changed() and adjust_whitespace_style() insert_character: (n, i, char) -> - return if @cursor.n.parent is @tree_parent # FIXME implement text nodes at top level - parent = @cursor.n.parent + return if n.parent is @tree_parent # FIXME implement text nodes at top level # insert the character if @insert_should_replace n, i n.text = char