Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
end = (typeof start == 'undefined') ? this.getContent().length : start;
}
if (typeof start == 'undefined') {
start = 0;
}
value = normalize(value);
// indent new value
if (!noIndent) {
var pad = utils.getLinePaddingFromPosition(this.getContent(), start);
value = utils.padString(value, pad);
}
// find new caret position
var tabstopData = tabStops.extract(value, {
escape: function(ch) {
return ch;
}
});
value = tabstopData.text;
var firstTabStop = tabstopData.tabstops[0] || {start: value.length, end: value.length};
firstTabStop.start += start;
firstTabStop.end += start;
var doc = this.editor.document;
start = this._posFromIndex(start);
end = this._posFromIndex(end);
var oldValue = doc.getRange(start, end);