JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
fix @insert_character: don't assume at cursor
authorJason Woofenden <jason@jasonwoof.com>
Fri, 8 Apr 2016 16:11:10 +0000 (12:11 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Fri, 8 Apr 2016 16:11:10 +0000 (12:11 -0400)
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