From a24eb02876715a0a604379c7b679f04ea58668a2 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 30 Oct 2023 02:56:03 +0300 Subject: [PATCH] node merging undo can merge merged sets... Signed-off-by: Alex A. Naanou --- experiments/outline-editor/editor.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index 00b88ce..643db70 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -1259,7 +1259,12 @@ var Outline = { if(stack == null || stack.length == 0){ return this } stack.push( - stack.splice(-n, n)) + stack.splice(-n, n) + .map(function(e){ + return typeof(e[1]) == 'string' ? + [e] + : e }) + .flat()) return this }, clearUndo: function(){ this.__undo_stack = undefined