emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/undo-tree 50ccefd 043/195: Fixed bug in undo-tree-disca


From: Stefan Monnier
Subject: [elpa] externals/undo-tree 50ccefd 043/195: Fixed bug in undo-tree-discard-node.
Date: Sat, 28 Nov 2020 13:41:18 -0500 (EST)

branch: externals/undo-tree
commit 50ccefd96b09748f58fbca546e558f7d97f4dc6e
Author: tsc25 <tsc25@cantab.net>
Commit: tsc25 <tsc25@cantab.net>

    Fixed bug in undo-tree-discard-node.
---
 undo-tree.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/undo-tree.el b/undo-tree.el
index 502803f..fcac771 100644
--- a/undo-tree.el
+++ b/undo-tree.el
@@ -466,6 +466,7 @@
 ;; Version 0.1.6
 ;; * added `undo-tree-mode-lighter' customization option to allow the
 ;;   mode-line lighter to be changed
+;; * bug-fix in `undo-tree-discard-node'
 ;;
 ;; Version 0.1.5
 ;; * modified `undo-tree-visualize' to mark the visualizer window as
@@ -929,7 +930,7 @@ Comparison is done with 'eq."
           (+ (undo-list-byte-size (undo-tree-node-undo node))
              (undo-list-byte-size (undo-tree-node-redo node))))
 
-    ;; discarding root node
+    ;; discarding root node...
     (if (eq node (undo-tree-root buffer-undo-tree))
         (cond
          ;; should always discard branches before root
@@ -938,7 +939,8 @@ Comparison is done with 'eq."
  has multiple branches"))
          ;; don't discard root if current node is only child
          ((eq (car (undo-tree-node-next node))
-              (undo-tree-current buffer-undo-tree)))
+              (undo-tree-current buffer-undo-tree))
+         nil)
          (t
           ;; make child of root into new root
           (setf node (setf (undo-tree-root buffer-undo-tree)
@@ -953,7 +955,7 @@ Comparison is done with 'eq."
               (undo-tree-oldest-leaf node)
             node)))
 
-      ;; discarding leaf node
+      ;; discarding leaf node...
       (let* ((parent (undo-tree-node-previous node))
              (current (nth (undo-tree-node-branch parent)
                            (undo-tree-node-next parent))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]