+ 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?
We're getting close but not quite there yet :-)
+ var node = e.rangeParent; node.data) ;
+ var offset = e.rangeOffset;
+ words.push(
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?