JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
bugfix: text insert one character from the end
authorJason Woofenden <jason@jasonwoof.com>
Sun, 20 Mar 2016 00:52:23 +0000 (20:52 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Sun, 20 Mar 2016 00:52:23 +0000 (20:52 -0400)
editor.coffee

index 7c57510..98c199c 100644 (file)
@@ -1023,10 +1023,10 @@ class PeachHTML5Editor
                                                        if needle is parent.attrs.style.substr parent.attrs.style.length - needle
                                                                parent.attrs.style = parent.attrs.style.substr 0, parent.attrs.style.length - needle
                                                                parent.el.setAttribute parent.attrs.style
-               # TODO insert the character now
+               # insert the character
                if i is 0
                        n.text = char + n.text
-               else if i is n.text.length - 1
+               else if i is n.text.length
                        n.text += char
                else
                        n.text =