@@ -283,3 +283,19 @@ async fn test_multi_selection_shell_commands() -> anyhow::Result<()> {
287+#[tokio::test(flavor = "multi_thread")]
288+async fn test_undo_redo() -> anyhow::Result<()> {
289+ // A jumplist selection is passed through an edit and then an undo and then a redo.
291+ // * [<space> Add a newline at line start. We're now on line 2.
292+ // * <C-s> Save the selection on line 2 in the jumplist.
293+ // * kd Delete line 1. The jumplist selection should be adjusted to the new line 1.
294+ // * uU Undo and redo the `kd` edit.
295+ // * <C-o> Jump back in the jumplist. This would panic if the jumplist were not being
296+ // updated correctly.
297+ // * <C-i> Jump forward to line 1.
298+ test(("#[|]#", "[<space><C-s>kduU<C-o><C-i>", "#[|]#")).await?;