0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 18:32:41 +00:00

Merge branch 'code-folding' into codemirror-tweaks

# Conflicts:
#	shared/naturalcrit/codeEditor/codeEditor.jsx
This commit is contained in:
Charlie Humphreys
2021-11-14 14:46:26 -06:00
2 changed files with 3 additions and 10 deletions

View File

@@ -92,8 +92,6 @@ const CodeEditor = createClass({
'Cmd-M' : this.makeSpan,
'Ctrl-/' : this.makeComment,
'Cmd-/' : this.makeComment,
'Ctrl-\\' : this.toggleCodeFolded,
'Cmd-\\' : this.toggleCodeFolded,
'Ctrl-[' : this.foldAllCode,
'Cmd-[' : this.foldAllCode,
'Ctrl-]' : this.unfoldAllCode,
@@ -171,10 +169,6 @@ const CodeEditor = createClass({
}
},
toggleCodeFolded : function() {
this.codeMirror.foldCode(this.codeMirror.getCursor());
},
foldAllCode : function() {
this.codeMirror.execCommand('foldAll');
},

View File

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