MCPcopy Create free account
hub / github.com/sql-js/sql.js / getBidi

Function getBidi

GUI/codemirror/lib/codemirror.js:1738–1751  ·  view source on GitHub ↗
(ch, partPos)

Source from the content-addressed store, hash-verified

1736 return intoCoordSystem(cm, lineObj, m, context);
1737 }
1738 function getBidi(ch, partPos) {
1739 var part = order[partPos], right = part.level % 2;
1740 if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {
1741 part = order[--partPos];
1742 ch = bidiRight(part) - (part.level % 2 ? 0 : 1);
1743 right = true;
1744 } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {
1745 part = order[++partPos];
1746 ch = bidiLeft(part) - part.level % 2;
1747 right = false;
1748 }
1749 if (right && ch == part.to && ch > part.from) return get(ch - 1);
1750 return get(ch, right);
1751 }
1752 var order = getOrder(lineObj), ch = pos.ch;
1753 if (!order) return get(ch);
1754 var partPos = getBidiPartAt(order, ch);

Callers 1

cursorCoordsFunction · 0.85

Calls 3

bidiLeftFunction · 0.85
bidiRightFunction · 0.85
getFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…