(order, pos)
| 8652 | } |
| 8653 | var bidiOther; |
| 8654 | function getBidiPartAt(order, pos) { |
| 8655 | bidiOther = null; |
| 8656 | for (var i = 0, found; i < order.length; ++i) { |
| 8657 | var cur = order[i]; |
| 8658 | if (cur.from < pos && cur.to > pos) return i; |
| 8659 | if ((cur.from == pos || cur.to == pos)) { |
| 8660 | if (found == null) { |
| 8661 | found = i; |
| 8662 | } else if (compareBidiLevel(order, cur.level, order[found].level)) { |
| 8663 | if (cur.from != cur.to) bidiOther = found; |
| 8664 | return i; |
| 8665 | } else { |
| 8666 | if (cur.from != cur.to) bidiOther = i; |
| 8667 | return found; |
| 8668 | } |
| 8669 | } |
| 8670 | } |
| 8671 | return found; |
| 8672 | } |
| 8673 | |
| 8674 | function moveInLine(line, pos, dir, byUnit) { |
| 8675 | if (!byUnit) return pos + dir; |
no test coverage detected