MCPcopy Index your code
hub / github.com/Macuyiko/minecraft-python / getWordIndex

Function getWordIndex

ServerEditorWeb/ace/ext-language_tools.js:1710–1713  ·  view source on GitHub ↗
(doc, pos)

Source from the content-addressed store, hash-verified

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);

Callers 1

wordDistanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected