(order, pos)
| 7232 | } |
| 7233 | var bidiOther; |
| 7234 | function getBidiPartAt(order, pos) { |
| 7235 | bidiOther = null; |
| 7236 | for (var i = 0, found; i < order.length; ++i) { |
| 7237 | var cur = order[i]; |
| 7238 | if (cur.from < pos && cur.to > pos) return i; |
| 7239 | if ((cur.from == pos || cur.to == pos)) { |
| 7240 | if (found == null) { |
| 7241 | found = i; |
| 7242 | } else if (compareBidiLevel(order, cur.level, order[found].level)) { |
| 7243 | if (cur.from != cur.to) bidiOther = found; |
| 7244 | return i; |
| 7245 | } else { |
| 7246 | if (cur.from != cur.to) bidiOther = i; |
| 7247 | return found; |
| 7248 | } |
| 7249 | } |
| 7250 | } |
| 7251 | return found; |
| 7252 | } |
| 7253 | |
| 7254 | function moveInLine(line, pos, dir, byUnit) { |
| 7255 | if (!byUnit) return pos + dir; |
no test coverage detected