(doc, line)
| 282 | } |
| 283 | |
| 284 | function lineLength(doc, line) { |
| 285 | if (line.height == 0) return 0; |
| 286 | var len = line.text.length, merged, cur = line; |
| 287 | while (merged = collapsedSpanAtStart(cur)) { |
| 288 | var found = merged.find(); |
| 289 | cur = getLine(doc, found.from.line); |
| 290 | len += found.from.ch - found.to.ch; |
| 291 | } |
| 292 | cur = line; |
| 293 | while (merged = collapsedSpanAtEnd(cur)) { |
| 294 | var found = merged.find(); |
| 295 | len -= cur.text.length - found.from.ch; |
| 296 | cur = getLine(doc, found.to.line); |
| 297 | len += cur.text.length - found.to.ch; |
| 298 | } |
| 299 | return len; |
| 300 | } |
| 301 | |
| 302 | function computeMaxLength(cm) { |
| 303 | var d = cm.display, doc = cm.doc; |
no test coverage detected