• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Pruebas Online
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

141
Vistas
Monaco Editor executeEdits does not preserve undo stack

I used this piece of code in the playground of the monaco diff editor, basically tried to call executeEdits twice, and hoping each ctrl+z would undo one change. but a single ctrl+z just made it go to the initial state. where did I do wrong please?

var originalModel = monaco.editor.createModel("heLLo world!\nabc", "text/plain");
var modifiedModel = monaco.editor.createModel("hello orlando!\n\nbbb", "text/plain");

var diffEditor = monaco.editor.createDiffEditor(document.getElementById("container"));
diffEditor.setModel({
    original: originalModel,
    modified: modifiedModel
});
setTimeout(()=>{

var op = {range:modifiedModel.getFullModelRange(), text: "claire"};
diffEditor.getModifiedEditor().executeEdits(null, [op]);},2000)


setTimeout(()=>{
var op2 = {range:modifiedModel.getFullModelRange(), text: "Paul"};
diffEditor.getModifiedEditor().executeEdits(null, [op2]);},3000)
almost 3 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda