0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-06 01:22:44 +00:00

More simplification to fold-code script

This commit is contained in:
Trevor Buckner
2021-11-13 20:57:33 -05:00
parent 2d30ac21a7
commit b67dc1621b

View File

@@ -6,13 +6,12 @@ module.exports = {
if(start.line === cm.firstLine() || prevLine.match(matcher)) { if(start.line === cm.firstLine() || prevLine.match(matcher)) {
const lastLineNo = cm.lastLine(); const lastLineNo = cm.lastLine();
let end = start.line, nextLine = cm.getLine(start.line + 1); let end = start.line;
while (end < lastLineNo) { while (end < lastLineNo) {
if(nextLine.match(matcher)) if(cm.getLine(end + 1).match(matcher))
break; break;
++end; ++end;
nextLine = cm.getLine(end + 1);
} }
return { return {
@@ -24,4 +23,4 @@ module.exports = {
return null; return null;
}); });
} }
}; };