mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 09:31:39 -05:00
Merge pull request #450 from dickmao/bug-issue-447
Disable undo when failure diagnostic triggered
This commit is contained in:
commit
9f2ad8bf10
1 changed files with 9 additions and 4 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Reference in a new issue