diff --git a/src/context.cc b/src/context.cc index 568142c6..3a0aadb4 100644 --- a/src/context.cc +++ b/src/context.cc @@ -225,11 +225,6 @@ void Context::SelectionHistory::undo() if (in_edition()) throw runtime_error("selection undo is only supported at top-level"); kak_assert(not empty()); - begin_edition(); - auto end = on_scope_end([&] { - kak_assert(current_history_node().selections == m_staging->selections); - end_edition(); - }); HistoryId next; if constexpr (backward) next = current_history_node().parent; @@ -242,7 +237,6 @@ void Context::SelectionHistory::undo() m_history_id = next; if constexpr (backward) current_history_node().redo_child = previous_id; - m_staging = current_history_node(); }; Buffer& destination_buffer = history_node(next).selections.buffer(); if (&destination_buffer == &m_context.buffer()) diff --git a/test/normal/selection-undo/windisplay-hook/cmd b/test/normal/selection-undo/windisplay-hook/cmd new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/normal/selection-undo/windisplay-hook/cmd @@ -0,0 +1 @@ + diff --git a/test/normal/selection-undo/windisplay-hook/in b/test/normal/selection-undo/windisplay-hook/in new file mode 100644 index 00000000..01e79c32 --- /dev/null +++ b/test/normal/selection-undo/windisplay-hook/in @@ -0,0 +1,3 @@ +1 +2 +3 diff --git a/test/normal/selection-undo/windisplay-hook/out b/test/normal/selection-undo/windisplay-hook/out new file mode 100644 index 00000000..92243f2b --- /dev/null +++ b/test/normal/selection-undo/windisplay-hook/out @@ -0,0 +1,3 @@ +1 +2 +here3 diff --git a/test/normal/selection-undo/windisplay-hook/rc b/test/normal/selection-undo/windisplay-hook/rc new file mode 100644 index 00000000..b157a2ce --- /dev/null +++ b/test/normal/selection-undo/windisplay-hook/rc @@ -0,0 +1 @@ +hook global WinDisplay .*/out %{exec j} diff --git a/test/normal/selection-undo/windisplay-hook/script b/test/normal/selection-undo/windisplay-hook/script new file mode 100644 index 00000000..d2fd1c40 --- /dev/null +++ b/test/normal/selection-undo/windisplay-hook/script @@ -0,0 +1,2 @@ +ui_out -ignore 4 +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "j:buffer *debug*ihere" ] }'