(doc, line)
| 268 | } |
| 269 | |
| 270 | function lineLength(doc, line) { |
| 271 | if (line.height == 0) return 0; |
| 272 | var len = line.text.length, merged, cur = line; |
| 273 | while (merged = collapsedSpanAtStart(cur)) { |
| 274 | var found = merged.find(); |
| 275 | cur = getLine(doc, found.from.line); |
| 276 | len += found.from.ch - found.to.ch; |
| 277 | } |
| 278 | cur = line; |
| 279 | while (merged = collapsedSpanAtEnd(cur)) { |
| 280 | var found = merged.find(); |
| 281 | len -= cur.text.length - found.from.ch; |
| 282 | cur = getLine(doc, found.to.line); |
| 283 | len += cur.text.length - found.to.ch; |
| 284 | } |
| 285 | return len; |
| 286 | } |
| 287 | |
| 288 | function computeMaxLength(cm) { |
| 289 | var d = cm.display, doc = cm.doc; |
no test coverage detected