diff --git a/CHANGELOG.md b/CHANGELOG.md index 434b6057..13c64005 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ - bug fixes - when using objects in properties, numbers-as-strings and booleans-as-strings values are now preserved instead of being converted to their litteral counterparts +- editor + - preserve code editor undo history between consecutive edits of a same widget's property + ## 1.30.1 - bug fixes diff --git a/src/client/ui/ui-code-editor.mjs b/src/client/ui/ui-code-editor.mjs index fd7a8b63..ecfe8e51 100644 --- a/src/client/ui/ui-code-editor.mjs +++ b/src/client/ui/ui-code-editor.mjs @@ -242,7 +242,11 @@ class CodeEditor { field.appendChild(this.helpBtn) field.appendChild(this.fsBtn) - editor.getSession().getUndoManager().reset() + if (this.hash !== widget.hash) { + // preserve undo history if widget is the same + editor.getSession().getUndoManager().reset() + this.hash = widget.hash + } editor.resize()