MCPcopy Index your code
hub / github.com/csev/py4e / getBidi

Function getBidi

tools/pythonauto/static/codemirror/codemirror.js:1229–1242  ·  view source on GitHub ↗
(ch, partPos)

Source from the content-addressed store, hash-verified

1227 return intoCoordSystem(cm, lineObj, m, context);
1228 }
1229 function getBidi(ch, partPos) {
1230 var part = order[partPos], right = part.level % 2;
1231 if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {
1232 part = order[--partPos];
1233 ch = bidiRight(part) - (part.level % 2 ? 0 : 1);
1234 right = true;
1235 } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {
1236 part = order[++partPos];
1237 ch = bidiLeft(part) - part.level % 2;
1238 right = false;
1239 }
1240 if (right && ch == part.to && ch > part.from) return get(ch - 1);
1241 return get(ch, right);
1242 }
1243 var order = getOrder(lineObj), ch = pos.ch;
1244 if (!order) return get(ch);
1245 var partPos = getBidiPartAt(order, ch);

Callers 1

cursorCoordsFunction · 0.70

Calls 3

bidiLeftFunction · 0.70
bidiRightFunction · 0.70
getFunction · 0.70

Tested by

no test coverage detected