(order, pos)
| 5863 | } |
| 5864 | var bidiOther; |
| 5865 | function getBidiPartAt(order, pos) { |
| 5866 | bidiOther = null; |
| 5867 | for (var i = 0, found; i < order.length; ++i) { |
| 5868 | var cur = order[i]; |
| 5869 | if (cur.from < pos && cur.to > pos) return i; |
| 5870 | if ((cur.from == pos || cur.to == pos)) { |
| 5871 | if (found == null) { |
| 5872 | found = i; |
| 5873 | } else if (compareBidiLevel(order, cur.level, order[found].level)) { |
| 5874 | if (cur.from != cur.to) bidiOther = found; |
| 5875 | return i; |
| 5876 | } else { |
| 5877 | if (cur.from != cur.to) bidiOther = i; |
| 5878 | return found; |
| 5879 | } |
| 5880 | } |
| 5881 | } |
| 5882 | return found; |
| 5883 | } |
| 5884 | |
| 5885 | function moveInLine(line, pos, dir, byUnit) { |
| 5886 | if (!byUnit) return pos + dir; |
no test coverage detected