Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
addUnderlineMarker(row) {
// Underline the problem line to make it more obvious
// if they don't notice the gutter icon
const AceRange = ace.require("ace/range").Range;
const line = this.editor.session.getDocument().getLine(row);
this.editor.session.addMarker(
new AceRange(row, 0, row, line.length),
"ace_problem_line", "text", false);
}
updateText: function(newText, customSelection, avoidUndo) {
if (!this.parent || this.parent.options.record && this.parent.options.record.playing) {
return;
}
var parent = this.parent;
var editor = parent.editor;
parent.ignore = true;
newText = newText.toString();
var Range = ace.require("ace/range").Range;
var loc = this.aceLocation;
var range = new Range(loc.row, loc.start, loc.row, loc.start + loc.length);
// We probably could just set it to false when we're done, but someone else might
// be trying a similar hack, or... who knows?
var undoState;
if (avoidUndo) {
undoState = editor.session.$fromUndo;
editor.session.$fromUndo = true;
}
editor.session.replace(range, newText);
if (avoidUndo) {
editor.session.$fromUndo = undoState;
}
range.end.column = range.start.column + newText.length;
editorInit (editor) {
editor.renderer.setScrollMargin(8, 8, 0, 0)
editor.setOptions({
indentedSoftWrap: false,
enableLiveAutocompletion: true,
showPrintMargin: false,
highlightActiveLine: false,
highlightGutterLine: false
})
const languageTools = ace.require('ace/ext/language_tools')
languageTools.addCompleter({
getCompletions: async (editor, session, pos, prefix, callback) => {
callback(null, this.completions)
}
})
setTimeout(() => {
editor.focus()
}, 100)
},
onCmdEnter (e) {