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

Function getBidiPartAt

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

Source from the content-addressed store, hash-verified

5863 }
5864 var bidiOther;
5865 function getBidiPartAt(order, pos) {
5866 bidiOther = null;
5867 for (var i = 0, found; i < order.length; ++i) {
5868 var cur = order[i];
5869 if (cur.from < pos && cur.to > pos) return i;
5870 if ((cur.from == pos || cur.to == pos)) {
5871 if (found == null) {
5872 found = i;
5873 } else if (compareBidiLevel(order, cur.level, order[found].level)) {
5874 if (cur.from != cur.to) bidiOther = found;
5875 return i;
5876 } else {
5877 if (cur.from != cur.to) bidiOther = i;
5878 return found;
5879 }
5880 }
5881 }
5882 return found;
5883 }
5884
5885 function moveInLine(line, pos, dir, byUnit) {
5886 if (!byUnit) return pos + dir;

Callers 2

cursorCoordsFunction · 0.70
moveVisuallyFunction · 0.70

Calls 1

compareBidiLevelFunction · 0.70

Tested by

no test coverage detected