MCPcopy
hub / github.com/nwutils/nw-sample-apps / getNonHidden

Function getNonHidden

mini-code-edit/cm/lib/codemirror.js:1216–1227  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

1214 }
1215 function skipHidden(pos, oldLine, oldCh) {
1216 function getNonHidden(dir) {
1217 var lNo = pos.line + dir, end = dir == 1 ? doc.size : -1;
1218 while (lNo != end) {
1219 var line = getLine(lNo);
1220 if (!line.hidden) {
1221 var ch = pos.ch;
1222 if (toEnd || ch > oldCh || ch > line.text.length) ch = line.text.length;
1223 return {line: lNo, ch: ch};
1224 }
1225 lNo += dir;
1226 }
1227 }
1228 var line = getLine(pos.line);
1229 var toEnd = pos.ch == line.text.length && pos.ch != oldCh;
1230 if (!line.hidden) return pos;

Callers 1

skipHiddenFunction · 0.85

Calls 1

getLineFunction · 0.85

Tested by

no test coverage detected