(order, pos)
| 8409 | } |
| 8410 | var bidiOther; |
| 8411 | function getBidiPartAt(order, pos) { |
| 8412 | bidiOther = null; |
| 8413 | for (var i = 0, found; i < order.length; ++i) { |
| 8414 | var cur = order[i]; |
| 8415 | if (cur.from < pos && cur.to > pos) return i; |
| 8416 | if ((cur.from == pos || cur.to == pos)) { |
| 8417 | if (found == null) { |
| 8418 | found = i; |
| 8419 | } else if (compareBidiLevel(order, cur.level, order[found].level)) { |
| 8420 | if (cur.from != cur.to) bidiOther = found; |
| 8421 | return i; |
| 8422 | } else { |
| 8423 | if (cur.from != cur.to) bidiOther = i; |
| 8424 | return found; |
| 8425 | } |
| 8426 | } |
| 8427 | } |
| 8428 | return found; |
| 8429 | } |
| 8430 | |
| 8431 | function moveInLine(line, pos, dir, byUnit) { |
| 8432 | if (!byUnit) return pos + dir; |
no test coverage detected