Comment 133 for bug 134813

Revision history for this message
In , Roc-ocallahan (roc-ocallahan) wrote :

We're getting close but not quite there yet :-)

+ var node = e.rangeParent;
+ var offset = e.rangeOffset;
+ words.push(node.data);

You're relying on the fact that the textarea breaks up each line into independent text nodes. That's not guaranteed, and in fact we're likely to change this soon. Here, you really should use 'offset' and check that the characters at 'offset' are the word you're expecting. Make sense?