(order, pos)
| 8684 | } |
| 8685 | var bidiOther; |
| 8686 | function getBidiPartAt(order, pos) { |
| 8687 | bidiOther = null; |
| 8688 | for (var i = 0, found; i < order.length; ++i) { |
| 8689 | var cur = order[i]; |
| 8690 | if (cur.from < pos && cur.to > pos) return i; |
| 8691 | if ((cur.from == pos || cur.to == pos)) { |
| 8692 | if (found == null) { |
| 8693 | found = i; |
| 8694 | } else if (compareBidiLevel(order, cur.level, order[found].level)) { |
| 8695 | if (cur.from != cur.to) bidiOther = found; |
| 8696 | return i; |
| 8697 | } else { |
| 8698 | if (cur.from != cur.to) bidiOther = i; |
| 8699 | return found; |
| 8700 | } |
| 8701 | } |
| 8702 | } |
| 8703 | return found; |
| 8704 | } |
| 8705 | |
| 8706 | function moveInLine(line, pos, dir, byUnit) { |
| 8707 | if (!byUnit) return pos + dir; |
no test coverage detected