MCPcopy Index your code
hub / github.com/csev/py4e / setLineHidden

Function setLineHidden

tools/pythonauto/static/codemirrorepl/codemirrorepl.js:1700–1726  ·  view source on GitHub ↗
(handle, hidden)

Source from the content-addressed store, hash-verified

1698 });
1699 }
1700 function setLineHidden(handle, hidden) {
1701 return changeLine(handle, function(line, no) {
1702 if (line.hidden != hidden) {
1703 line.hidden = hidden;
1704 if (!options.lineWrapping) {
1705 var l = line.text;
1706 if (hidden && l.length == maxLine.length) {
1707 maxLengthChanged = true;
1708 }
1709 else if (!hidden && l.length > maxLine.length) {
1710 maxLine = l; maxWidth = null;
1711 maxLengthChanged = false;
1712 }
1713 }
1714 updateLineHeight(line, hidden ? 0 : 1);
1715 var fline = sel.from.line, tline = sel.to.line;
1716 if (hidden && (fline == no || tline == no)) {
1717 var from = fline == no ? skipHidden({line: fline, ch: 0}, fline, 0) : sel.from;
1718 var to = tline == no ? skipHidden({line: tline, ch: 0}, tline, 0) : sel.to;
1719 // Can't hide the last visible line, we'd have no place to put the cursor
1720 if (!to) return;
1721 setSelection(from, to);
1722 }
1723 return (gutterDirty = true);
1724 }
1725 });
1726 }
1727
1728 function lineInfo(line) {
1729 if (typeof line == "number") {

Callers 2

CodeMirrorFunction · 0.85
setSelectionFunction · 0.85

Calls 4

skipHiddenFunction · 0.85
changeLineFunction · 0.70
updateLineHeightFunction · 0.70
setSelectionFunction · 0.70

Tested by

no test coverage detected