MCPcopy
hub / github.com/witheve/Eve / getBidiPartAt

Function getBidiPartAt

src/codemirror.js:8686–8704  ·  view source on GitHub ↗
(order, pos)

Source from the content-addressed store, hash-verified

8684 }
8685 var bidiOther;
8686 function getBidiPartAt(order, pos) {
8687 bidiOther = null;
8688 for (var i = 0, found; i < order.length; ++i) {
8689 var cur = order[i];
8690 if (cur.from < pos && cur.to > pos) return i;
8691 if ((cur.from == pos || cur.to == pos)) {
8692 if (found == null) {
8693 found = i;
8694 } else if (compareBidiLevel(order, cur.level, order[found].level)) {
8695 if (cur.from != cur.to) bidiOther = found;
8696 return i;
8697 } else {
8698 if (cur.from != cur.to) bidiOther = i;
8699 return found;
8700 }
8701 }
8702 }
8703 return found;
8704 }
8705
8706 function moveInLine(line, pos, dir, byUnit) {
8707 if (!byUnit) return pos + dir;

Callers 3

posToDOMFunction · 0.85
cursorCoordsFunction · 0.85
moveVisuallyFunction · 0.85

Calls 1

compareBidiLevelFunction · 0.85

Tested by

no test coverage detected