From d7a19d98590538432f833d143bb27ffe24acad30 Mon Sep 17 00:00:00 2001 From: dickmao Date: Sat, 14 Mar 2020 12:05:29 -0400 Subject: [PATCH] getting undo failure diagnostic in gha --- features/step-definitions/ein-steps.el | 6 ++++++ features/undo.feature | 1 + lisp/ein-worksheet.el | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/features/step-definitions/ein-steps.el b/features/step-definitions/ein-steps.el index ee1d07b..dbcc37b 100644 --- a/features/step-definitions/ein-steps.el +++ b/features/step-definitions/ein-steps.el @@ -297,6 +297,12 @@ (When "I call \"ein:notebooklist-login\"") (And "I wait for the smoke to clear"))))))) +(When "^dump diagnostic" + (lambda () + (let ((fill (- (length buffer-undo-list) (length ein:%which-cell%)))) + (message "Undo failure diagnostic %s %s | %s" + buffer-undo-list ein:%which-cell% fill)))) + (When "^eval \"\\(.*\\)\"$" (lambda (command) (eval (car (read-from-string command))))) diff --git a/features/undo.feature b/features/undo.feature index cb93810..13ca4e0 100644 --- a/features/undo.feature +++ b/features/undo.feature @@ -251,6 +251,7 @@ Scenario: Execute all cells, mod some cells, get outputs, undo mods And I undo again Then the cursor should be at point "139" And I undo again + And dump diagnostic Then the cursor should be at point "125" @undo diff --git a/lisp/ein-worksheet.el b/lisp/ein-worksheet.el index 5c376cc..abd0963 100644 --- a/lisp/ein-worksheet.el +++ b/lisp/ein-worksheet.el @@ -57,10 +57,10 @@ (ein:deflocal buffer-local-enable-undo t "Buffer local variable activating undo accounting. Should not modify.") -(ein:deflocal ein:%cell-lengths% '() +(ein:deflocal ein:%cell-lengths% nil "Buffer local variable with buffer-undo-list's current knowledge of cell lengths.") -(ein:deflocal ein:%which-cell% '() +(ein:deflocal ein:%which-cell% nil "Buffer local variable one-to-one buffer-undo-list item to cell id.") (defsubst ein:worksheet--unique-enough-cell-id (cell)