mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 20:42:43 +00:00
@@ -91,6 +91,7 @@ const CodeEditor = createClass({
|
||||
},
|
||||
foldGutter : true,
|
||||
foldOptions : {
|
||||
scanUp : true,
|
||||
rangeFinder : CodeMirror.fold.homebrewery,
|
||||
widget : (from, to)=>{
|
||||
let text = '';
|
||||
@@ -98,13 +99,16 @@ const CodeEditor = createClass({
|
||||
const maxLength = 50;
|
||||
while (currentLine <= to.line && text.length <= maxLength) {
|
||||
text += this.codeMirror.getLine(currentLine);
|
||||
if(currentLine < to.line) {
|
||||
if(currentLine < to.line)
|
||||
text += ' ';
|
||||
}
|
||||
currentLine += 1;
|
||||
}
|
||||
|
||||
return `\u21A4${text.substr(0, maxLength)}\u21A6`;
|
||||
text = text.trim();
|
||||
if(text.length > maxLength)
|
||||
text = `${text.substr(0, maxLength)}...`;
|
||||
|
||||
return `\u21A4 ${text} \u21A6`;
|
||||
}
|
||||
},
|
||||
gutters : ['CodeMirror-linenumbers', 'CodeMirror-foldgutter']
|
||||
|
||||
Reference in New Issue
Block a user