MCPcopy
hub / github.com/csev/py4e / getBidiPartAt

Function getBidiPartAt

tools/pythonauto/static/codemirrorepl/codemirror.js:7234–7252  ·  view source on GitHub ↗
(order, pos)

Source from the content-addressed store, hash-verified

7232 }
7233 var bidiOther;
7234 function getBidiPartAt(order, pos) {
7235 bidiOther = null;
7236 for (var i = 0, found; i < order.length; ++i) {
7237 var cur = order[i];
7238 if (cur.from < pos && cur.to > pos) return i;
7239 if ((cur.from == pos || cur.to == pos)) {
7240 if (found == null) {
7241 found = i;
7242 } else if (compareBidiLevel(order, cur.level, order[found].level)) {
7243 if (cur.from != cur.to) bidiOther = found;
7244 return i;
7245 } else {
7246 if (cur.from != cur.to) bidiOther = i;
7247 return found;
7248 }
7249 }
7250 }
7251 return found;
7252 }
7253
7254 function moveInLine(line, pos, dir, byUnit) {
7255 if (!byUnit) return pos + dir;

Callers 2

cursorCoordsFunction · 0.70
moveVisuallyFunction · 0.70

Calls 1

compareBidiLevelFunction · 0.70

Tested by

no test coverage detected