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

Function getBidiPartAt

GUI/codemirror/lib/codemirror.js:7292–7310  ·  view source on GitHub ↗
(order, pos)

Source from the content-addressed store, hash-verified

7290 }
7291 var bidiOther;
7292 function getBidiPartAt(order, pos) {
7293 bidiOther = null;
7294 for (var i = 0, found; i < order.length; ++i) {
7295 var cur = order[i];
7296 if (cur.from < pos && cur.to > pos) return i;
7297 if ((cur.from == pos || cur.to == pos)) {
7298 if (found == null) {
7299 found = i;
7300 } else if (compareBidiLevel(order, cur.level, order[found].level)) {
7301 if (cur.from != cur.to) bidiOther = found;
7302 return i;
7303 } else {
7304 if (cur.from != cur.to) bidiOther = i;
7305 return found;
7306 }
7307 }
7308 }
7309 return found;
7310 }
7311
7312 function moveInLine(line, pos, dir, byUnit) {
7313 if (!byUnit) return pos + dir;

Callers 2

cursorCoordsFunction · 0.85
moveVisuallyFunction · 0.85

Calls 1

compareBidiLevelFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…