Merge pull request #450 from dickmao/bug-issue-447

Disable undo when failure diagnostic triggered
This commit is contained in:
John Miller 2019-01-08 21:03:14 -06:00 committed by GitHub
commit 9f2ad8bf10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -182,10 +182,15 @@
(let ((fill (- (length buffer-undo-list) (length ein:%which-cell%)))) (let ((fill (- (length buffer-undo-list) (length ein:%which-cell%))))
(if (> (abs fill) 1) (if (> (abs fill) 1)
;; TODO: reset ein:%which-cell% when major mode gets swapped ;; TODO: reset ein:%which-cell% when major mode gets swapped
(progn
(ein:display-warning (ein:display-warning
(format "Undo failure diagnostic %s %s | %s" (format "Undo failure diagnostic %s %s | %s"
buffer-undo-list ein:%which-cell% fill) buffer-undo-list ein:%which-cell% fill)
:error) :error)
(setq ein:worksheet-enable-undo nil)
(setq buffer-local-enable-undo ein:worksheet-enable-undo)
(ein:worksheet-render (ein:worksheet--get-ws-or-error))
(ein:worksheet-focus-cell))
(if (< fill 0) (if (< fill 0)
(setq ein:%which-cell% (nthcdr (- fill) ein:%which-cell%)) (setq ein:%which-cell% (nthcdr (- fill) ein:%which-cell%))
(if (> fill 0) (if (> fill 0)