(handle, hidden)
| 1498 | }); |
| 1499 | } |
| 1500 | function setLineHidden(handle, hidden) { |
| 1501 | return changeLine(handle, function(line, no) { |
| 1502 | if (line.hidden != hidden) { |
| 1503 | line.hidden = hidden; |
| 1504 | if (!options.lineWrapping) { |
| 1505 | var l = line.text; |
| 1506 | if (hidden && l.length == maxLine.length) { |
| 1507 | maxLengthChanged = true; |
| 1508 | } |
| 1509 | else if (!hidden && l.length > maxLine.length) { |
| 1510 | maxLine = l; maxWidth = null; |
| 1511 | maxLengthChanged = false; |
| 1512 | } |
| 1513 | } |
| 1514 | updateLineHeight(line, hidden ? 0 : 1); |
| 1515 | var fline = sel.from.line, tline = sel.to.line; |
| 1516 | if (hidden && (fline == no || tline == no)) { |
| 1517 | var from = fline == no ? skipHidden({line: fline, ch: 0}, fline, 0) : sel.from; |
| 1518 | var to = tline == no ? skipHidden({line: tline, ch: 0}, tline, 0) : sel.to; |
| 1519 | // Can't hide the last visible line, we'd have no place to put the cursor |
| 1520 | if (!to) return; |
| 1521 | setSelection(from, to); |
| 1522 | } |
| 1523 | return (gutterDirty = true); |
| 1524 | } |
| 1525 | }); |
| 1526 | } |
| 1527 | |
| 1528 | function lineInfo(line) { |
| 1529 | if (typeof line == "number") { |
no test coverage detected