(from, to, className)
| 1430 | }; |
| 1431 | |
| 1432 | function markText(from, to, className) { |
| 1433 | from = clipPos(from); to = clipPos(to); |
| 1434 | var tm = new TextMarker(); |
| 1435 | if (!posLess(from, to)) return tm; |
| 1436 | function add(line, from, to, className) { |
| 1437 | getLine(line).addMark(new MarkedText(from, to, className, tm)); |
| 1438 | } |
| 1439 | if (from.line == to.line) add(from.line, from.ch, to.ch, className); |
| 1440 | else { |
| 1441 | add(from.line, from.ch, null, className); |
| 1442 | for (var i = from.line + 1, e = to.line; i < e; ++i) |
| 1443 | add(i, null, null, className); |
| 1444 | add(to.line, null, to.ch, className); |
| 1445 | } |
| 1446 | changes.push({from: from.line, to: to.line + 1}); |
| 1447 | return tm; |
| 1448 | } |
| 1449 | |
| 1450 | function setBookmark(pos) { |
| 1451 | pos = clipPos(pos); |
no test coverage detected