(doc, pos)
| 1708 | var splitRegex = /[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/; |
| 1709 | |
| 1710 | function getWordIndex(doc, pos) { |
| 1711 | var textBefore = doc.getTextRange(Range.fromPoints({row: 0, column:0}, pos)); |
| 1712 | return textBefore.split(splitRegex).length - 1; |
| 1713 | } |
| 1714 | function wordDistance(doc, pos) { |
| 1715 | var prefixPos = getWordIndex(doc, pos); |
| 1716 | var words = doc.getValue().split(splitRegex); |