From 7c4d6908d74e271982d347bab356beee2ec22e37 Mon Sep 17 00:00:00 2001 From: "Jessica B. Hamrick" Date: Wed, 28 Oct 2015 14:31:59 -0700 Subject: [PATCH] Fix bug in undoing merges --- notebook/static/notebook/js/notebook.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/notebook/static/notebook/js/notebook.js b/notebook/static/notebook/js/notebook.js index 228bad017..6d05ed1de 100644 --- a/notebook/static/notebook/js/notebook.js +++ b/notebook/static/notebook/js/notebook.js @@ -1027,6 +1027,13 @@ define(function (require) { this.select(cursor_ix_after); } + // Check if the cells were after the cursor + for (var i=0; i < indices.length; i++) { + if (indices[i] > cursor_ix_before) { + this.undelete_below = true; + } + } + // This will put all the deleted cells back in one location, rather than // where they came from. It will do until we have proper undo support. this.undelete_index = cursor_ix_after;