(doc, n)
| 1113 | // Most of the external API clips given positions to make sure they |
| 1114 | // actually exist within the document. |
| 1115 | function clipLine(doc, n) { |
| 1116 | return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1)) |
| 1117 | } |
| 1118 | function clipPos(doc, pos) { |
| 1119 | if (pos.line < doc.first) { |
| 1120 | return Pos(doc.first, 0) |
no test coverage detected