MCPcopy
hub / github.com/DHTMLX/gantt / getBidiPartAt

Function getBidiPartAt

samples/common/codehighlight/codemirror.js:329–345  ·  view source on GitHub ↗
(order, ch, sticky)

Source from the content-addressed store, hash-verified

327
328 var bidiOther = null;
329 function getBidiPartAt(order, ch, sticky) {
330 var found;
331 bidiOther = null;
332 for (var i = 0; i < order.length; ++i) {
333 var cur = order[i];
334 if (cur.from < ch && cur.to > ch) { return i }
335 if (cur.to == ch) {
336 if (cur.from != cur.to && sticky == "before") { found = i; }
337 else { bidiOther = i; }
338 }
339 if (cur.from == ch) {
340 if (cur.from != cur.to && sticky != "before") { found = i; }
341 else { bidiOther = i; }
342 }
343 }
344 return found != null ? found : bidiOther
345 }
346
347 // Bidirectional ordering algorithm
348 // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm

Callers 4

cursorCoordsFunction · 0.85
moveVisuallyFunction · 0.85
bidiSimplifyFunction · 0.85
posToDOMFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected