Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
if (cursorOnBracket && row === visibleCursor.row) {
line = markup(line, bracketStyle,
visibleCursor.column - column,
visibleCursor.column - column + 1);
}
if (visibleMatchingBracket && row === visibleMatchingBracket.row) {
line = markup(line, bracketStyle,
visibleMatchingBracket.column - column,
visibleMatchingBracket.column - column + 1);
}
bufferContent.push(line + '{/}');
var gutterLine = (_.repeat(' ', lineNumberWidth).join('') + (row + 1)).slice(-lineNumberWidth);
gutterLine += _.repeat(' ', gutterWidth).join('');
if (currentLineStyle && row === visibleCursor.row) {
gutterLine = markup(gutterLine, currentLineStyle);
}
gutterContent.push(gutterLine + '{/}');
});
Editor.prototype._renderableTabString = function (match) {
return !this.buffer.options.visibleWhiteSpace
? _.repeat(' ', this.buffer.options.tabSize * match.length).join('')
: markup(_.repeat(
_.repeat('\u2500', this.buffer.options.tabSize - 1).join('') +
(this.buffer.options.tabSize ? '\u2574' : '')
, match.length).join(''), this.options.style.whiteSpace)
};
Editor.prototype._renderableSpace = function (match) {
Editor.prototype._renderableSpace = function (match) {
return !this.buffer.options.visibleWhiteSpace
? match
: markup(_.repeat('\u00b7', match.length).join(''), this.options.style.whiteSpace);
};
Editor.prototype._renderableLineEnding = function (lineEnding) {
content: prompts.map(function (prompt) {
return markup(
(' ' + prompt + ':' + _.repeat(' ', labelWidth).join('')).slice(0, labelWidth),
self.options.style.prompt || self.options.style.main);
}).join('\n'),
top: 0,
Editor.prototype._getTabString = function () {
var self = this;
return self.buffer.options.useSpaces
? _.repeat(' ', self.buffer.options.tabSize).join('')
: '\t';
};
Editor.prototype.indent = function (range, dedent) {
Editor.prototype._renderableTabString = function (match) {
return !this.buffer.options.visibleWhiteSpace
? _.repeat(' ', this.buffer.options.tabSize * match.length).join('')
: markup(_.repeat(
_.repeat('\u2500', this.buffer.options.tabSize - 1).join('') +
(this.buffer.options.tabSize ? '\u2574' : '')
, match.length).join(''), this.options.style.whiteSpace)
};
Editor.prototype._renderableSpace = function (match) {
Editor.prototype._renderableTabString = function (match) {
return !this.buffer.options.visibleWhiteSpace
? _.repeat(' ', this.buffer.options.tabSize * match.length).join('')
: markup(_.repeat(
_.repeat('\u2500', this.buffer.options.tabSize - 1).join('') +
(this.buffer.options.tabSize ? '\u2574' : '')
, match.length).join(''), this.options.style.whiteSpace)
};
Editor.prototype._renderableSpace = function (match) {
if (cursorOnBracket && row === visibleCursor.row) {
line = markup(line, bracketStyle,
visibleCursor.column - column,
visibleCursor.column - column + 1);
}
if (visibleMatchingBracket && row === visibleMatchingBracket.row) {
line = markup(line, bracketStyle,
visibleMatchingBracket.column - column,
visibleMatchingBracket.column - column + 1);
}
bufferContent.push(line + '{/}');
var gutterLine = (_.repeat(' ', lineNumberWidth).join('') + (row + 1)).slice(-lineNumberWidth);
gutterLine += _.repeat(' ', gutterWidth).join('');
if (currentLineStyle && row === visibleCursor.row) {
gutterLine = markup(gutterLine, currentLineStyle);
}
gutterContent.push(gutterLine + '{/}');
});
markupPath = markup(markupPath+'*', style.changed);
}
left += markupPath;
var right = [(cursor.y+1)+','+(cursor.x+1) + ' ('+self.editor.lines().length+')'];
if (!self.insertMode()) right.unshift(markup('OVR', '{red-bg}{white-fg}'));
var message = self.message();
if (message) {
if (self._blink()) message = markup(message, style.blink);
right.unshift(message);
}
right = right.join(' ') + ' ';
var remainingWidth = self.header.width - self.header.iwidth - markup.strip(left + right).length;
self.header.setContent(markup(
left + _.repeat(' ', remainingWidth).join('') + right
, style.header || style.main));
return blessed.Screen.prototype.render.apply(self, arguments);
};
Editor.prototype.realPos = function (pos) {
var self = this;
if (pos instanceof Range) return new Range(self.realPos(pos.start), self.realPos(pos.end));
pos = self.textBuf.clipPosition(Point.fromObject(pos, true));
pos.column = this.lineWithEndingForRow(pos.row)
.replace(Editor._tabRegExp, _.repeat('\t', this.buffer.options.tabSize).join(''))
.slice(0, Math.max(pos.column, 0))
.replace(new RegExp('\\t{1,'+this.buffer.options.tabSize+'}', 'g'), '\t')
.length;
return pos;
};