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

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

[elpa] externals/undo-tree 4877b0f 008/195: Added markers to record posi


From: Stefan Monnier
Subject: [elpa] externals/undo-tree 4877b0f 008/195: Added markers to record positions of nodes in visualizer.
Date: Sat, 28 Nov 2020 13:41:10 -0500 (EST)

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

    Added markers to record positions of nodes in visualizer.
    Implemeneted highlighting of current node.
---
 undo-tree.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/undo-tree.el b/undo-tree.el
index a1dda4c..c33e656 100644
--- a/undo-tree.el
+++ b/undo-tree.el
@@ -360,13 +360,17 @@ using `undo-tree-redo'."
   ;; prepare *undo-tree* buffer, then draw tree in it
   (let ((undo-tree buffer-undo-tree))
     (switch-to-buffer-other-window " *undo-tree*")
+    (setq cursor-type nil)
     (erase-buffer)
     (undo-tree-move-down 1)  ; top margin
     (undo-tree-compute-widths undo-tree)
     (undo-tree-move-forward
      (+ (undo-tree-node-char-lwidth (undo-tree-root undo-tree))
        2))  ; left margin
-    (undo-tree-draw-subtree (undo-tree-root undo-tree))))
+    (undo-tree-draw-subtree (undo-tree-root undo-tree))
+    (goto-char (undo-tree-node-marker (undo-tree-current undo-tree)))
+    (put-text-property (point) (1+ (point)) 'face '(foreground-color . "red"))
+    ))
 
 
 
@@ -377,6 +381,7 @@ using `undo-tree-redo'."
     ;; draw node itself
     (undo-tree-insert ?o)
     (backward-char 1)
+    (move-marker (setf (undo-tree-node-marker node) (make-marker)) (point))
 
     (cond
      ;; if we're at a leaf node, we're done



reply via email to

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