Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
update: function(abbr) {
var result, replaced;
for (var i = selCtx.length - 1, ctx; i >= 0; i--) {
ctx = selCtx[i];
result = '';
try {
if (abbr) {
result = parser.expand(abbr, ctx);
} else {
result = ctx.pastedContent;
}
} catch (e) {
console.error(e);
result = ctx.pastedContent;
}
editor._selection.index = i;
replaced = editor.replaceContent(result, ctx.selection.start, ctx.selection.end);
ctx.finalCaret = getCaret(editor.editor);
updateFinalCarets(selCtx, i, lineDelta(ctx.pastedContent, replaced));
}
},
confirm: function() {