mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 09:31:39 -05:00
Allow no undo after deleting a cell
This commit is contained in:
parent
98ae4efbb9
commit
e5a4e8a229
2 changed files with 16 additions and 1 deletions
|
@ -307,7 +307,8 @@ the time of execution."
|
|||
;; Insertion and deletion of cells
|
||||
|
||||
(defun ein:notebook-delete-cell (notebook cell)
|
||||
(let ((inhibit-read-only t))
|
||||
(let ((inhibit-read-only t)
|
||||
(buffer-undo-list t)) ; disable undo recording
|
||||
(apply #'ewoc-delete
|
||||
(ein:$notebook-ewoc notebook)
|
||||
(ein:cell-all-element cell)))
|
||||
|
|
|
@ -126,6 +126,20 @@
|
|||
do (ein:notebook-delete-cell-command))
|
||||
(should (equal (ein:notebook-ncells ein:notebook) 0))))
|
||||
|
||||
(ert-deftest ein:notebook-delete-cell-command-no-undo ()
|
||||
(with-current-buffer (eintest:notebook-make-empty)
|
||||
(ein:notebook-insert-cell-above-command)
|
||||
(insert "some text")
|
||||
(should (equal (buffer-string) "
|
||||
In [ ]:
|
||||
some text
|
||||
|
||||
"))
|
||||
(ein:notebook-kill-cell-command)
|
||||
(should (equal (buffer-string) "\n"))
|
||||
(should-error (undo)) ; should be ignore-error?
|
||||
(should (equal (buffer-string) "\n"))))
|
||||
|
||||
(ert-deftest ein:notebook-kill-cell-command-simple ()
|
||||
(with-current-buffer (eintest:notebook-make-empty)
|
||||
(let (ein:kill-ring ein:kill-ring-yank-pointer)
|
||||
|
|
Loading…
Add table
Reference in a new issue