JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
fix typo/crash in chrome for empty text nodes
authorJason Woofenden <jason@jasonwoof.com>
Tue, 8 Mar 2016 17:30:45 +0000 (12:30 -0500)
committerJason Woofenden <jason@jasonwoof.com>
Tue, 8 Mar 2016 17:30:45 +0000 (12:30 -0500)
editor.coffee

index ceffb9a..45e5f36 100644 (file)
@@ -98,7 +98,7 @@ window.cursor_to_xyh = cursor_to_xyh = (n, i) ->
        range = document.createRange()
        if n.text.length is 0
                ret = text_range_bounds n.el, 0, 0
-       if i is n.text.length
+       else if i is n.text.length
                ret = text_range_bounds n.el, i - 1, i
                if ret?
                        ret.x += ret.w