JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
fix @insert_character: don't assume at cursor
[peach-html5-editor.git] / editor.coffee
index 9f6d8eb..60ea832 100644 (file)
@@ -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