Dblclick at end of word selects previous word

Fixes selectWord so that double clicking at the end of a word (just after the last character in the left half of the space) selects the previous word.  Again this is MS Word behaviour.
This commit is contained in:
GordoRank 2014-01-14 00:25:42 +00:00
parent 1499baa7c3
commit a2cf96a020

View file

@ -257,7 +257,7 @@
* @param {Number} direction: 1 or -1
*/
searchWordBoundary: function(selectionStart, direction) {
var index = selectionStart;
var index = (this._reSpace.test(this.text.charAt(selectionStart))) ? selectionStart-1 : selectionStart;
var _char = this.text.charAt(index);
var reNonWord = /[ \n\.,;!\?\-]/;