[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/treeview b53c339572 13/25: Bugfix for updating hidden node
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/treeview b53c339572 13/25: Bugfix for updating hidden nodes |
Date: |
Sat, 10 Sep 2022 17:59:38 -0400 (EDT) |
branch: elpa/treeview
commit b53c33957217a85312c0ff284905365d6d590e51
Author: Tilman Rassy <tilman.rassy@googlemail.com>
Commit: Tilman Rassy <tilman.rassy@googlemail.com>
Bugfix for updating hidden nodes
---
treeview.el | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/treeview.el b/treeview.el
index fc4104f335..a3201ac77c 100644
--- a/treeview.el
+++ b/treeview.el
@@ -269,6 +269,13 @@ node has no children or is unread (i.e., its state is
'folded-unred'.")
Calls the buffer local function `treeview-node-leaf-p-function' with one
argument, NODE."
(funcall treeview-node-leaf-p-function node))
+(defun treeview-node-not-hidden-p (node)
+ "Return non-nil if NODE is not hidden, otherwise nil.
+A node is not hidden if all its ancestors are expanded. A node with no
+ancestors (thus, the root node) is also not hidden."
+ (let ( (parent (treeview-get-node-parent node)) )
+ (if parent (and (treeview-node-expanded-p parent)
(treeview-node-not-hidden-p parent)) t)))
+
(defun treeview-put (&rest objects)
"Insert OBJECTS at point.
Each element of OBJECTS may be a string, a character, an image, nil, or a list.
@@ -745,14 +752,14 @@ The first one does the rendering, the latter one fixes the
(defun treeview-insert-node-after (node anchor)
"Insert NODE after ANCHOR.
ANCHOR must be a cons cell of the list of children of a node. NODE is inserted
-after this cons cell. NODE is also displayed if the parent is expanded."
+after this cons cell. NODE is also displayed if the parent is not hidden."
(let* ( (anchor-node (car anchor))
(parent (treeview-get-node-parent anchor-node))
(new-cons (cons node nil)) )
(setcdr new-cons (cdr anchor))
(setcdr anchor new-cons)
(treeview-set-node-parent node parent)
- (when (treeview-node-expanded-p parent)
+ (when (treeview-node-not-hidden-p parent)
(let ( (buffer-read-only nil) )
(goto-char (treeview-get-node-prop anchor-node 'end))
(end-of-line)
@@ -763,12 +770,12 @@ after this cons cell. NODE is also displayed if the
parent is expanded."
(defun treeview-add-child-at-front (parent node)
"Insert NODE at the beginning of the children of PARENT.
Thus, NODE becomes the new first child of PARENT. NODE is also displayed if
-PARENT is expanded."
+PARENT is not hidden."
(let ( (children (treeview-get-node-children parent)) )
(setq children (cons node children))
(treeview-set-node-parent node parent)
(treeview-set-node-children parent children)
- (when (treeview-node-expanded-p parent)
+ (when (treeview-node-not-hidden-p parent)
(let ( (buffer-read-only nil) )
(goto-char (treeview-get-node-prop parent 'start))
(end-of-line)
@@ -836,11 +843,11 @@ The main purpose of this function is to implement the
functions
(defun treeview-remove-node (node)
"Remove NODE from the tree.
-NODE is also erased from the display if its parent is expanded. It is also
+NODE is also erased from the display if its parent is not hidden. It is also
erased if it has no parent, thus, if it is the root node."
(let ( (parent (treeview-get-node-parent node) ) )
(when parent (treeview-remove-child parent node))
- (when (or (not parent) (treeview-node-expanded-p parent))
(treeview-undisplay-node node t))))
+ (when (or (not parent) (treeview-node-not-hidden-p parent))
(treeview-undisplay-node node t))))
(defun treeview-redisplay-node (node)
"Redisplay NODE.
- [nongnu] branch elpa/treeview created (now 09c8c1d045), ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview d8b8b4a533 02/25: First version of README.md, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 2d6b185055 10/25: Updated package URL and years in copyright, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview b53c339572 13/25: Bugfix for updating hidden nodes,
ELPA Syncer <=
- [nongnu] elpa/treeview a058a07149 12/25: Minor changes in library header comments, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 6b22e03b15 21/25: Implemented selection of nodes, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 09c8c1d045 25/25: Additions to documentation, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 3130757444 05/25: Added new function treeview-call-for-node-at-point, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 0044b119e7 11/25: Updated documentation, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 86d6734aef 15/25: Renamed function treeview-display-node-internal to treeview-render-node, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview ad9c094d89 23/25: Implemented selection of files and highlighting of nodes, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 0681739fdd 01/25: Initial commit, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 0d66ef2322 22/25: Made treeview-after-node-expanded-function and treeview-after-node-folded-function buffer-local, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 00a4ab92bd 19/25: Changed http to https in link to GNU licenses, ELPA Syncer, 2022/09/10