[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/treeview 4a341b05bc 14/25: Bugfix for updating hidden node
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/treeview 4a341b05bc 14/25: Bugfix for updating hidden nodes |
Date: |
Sat, 10 Sep 2022 17:59:38 -0400 (EDT) |
branch: elpa/treeview
commit 4a341b05bc8c2e5f095f5c28669ff78fbef54aa9
Author: Tilman Rassy <tilman.rassy@googlemail.com>
Commit: Tilman Rassy <tilman.rassy@googlemail.com>
Bugfix for updating hidden nodes
---
treeview.el | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/treeview.el b/treeview.el
index a3201ac77c..6fd4ead5ce 100644
--- a/treeview.el
+++ b/treeview.el
@@ -274,7 +274,13 @@ Calls the buffer local function
`treeview-node-leaf-p-function' with one argumen
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)))
+ (or (not parent) (and (treeview-node-expanded-p parent)
(treeview-node-not-hidden-p parent)))))
+
+(defun treeview-node-expanded-and-not-hidden-p (node)
+ "Return non-nil if NODE is expanded and 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."
+ (and (treeview-node-expanded-p node) (treeview-node-not-hidden-p node)))
(defun treeview-put (&rest objects)
"Insert OBJECTS at point.
@@ -759,7 +765,7 @@ after this cons cell. NODE is also displayed if the parent
is not hidden."
(setcdr new-cons (cdr anchor))
(setcdr anchor new-cons)
(treeview-set-node-parent node parent)
- (when (treeview-node-not-hidden-p parent)
+ (when (treeview-node-expanded-and-not-hidden-p parent)
(let ( (buffer-read-only nil) )
(goto-char (treeview-get-node-prop anchor-node 'end))
(end-of-line)
@@ -775,7 +781,7 @@ PARENT is not hidden."
(setq children (cons node children))
(treeview-set-node-parent node parent)
(treeview-set-node-children parent children)
- (when (treeview-node-not-hidden-p parent)
+ (when (treeview-node-expanded-and-not-hidden-p parent)
(let ( (buffer-read-only nil) )
(goto-char (treeview-get-node-prop parent 'start))
(end-of-line)
@@ -847,7 +853,7 @@ 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-not-hidden-p parent))
(treeview-undisplay-node node t))))
+ (when (treeview-node-not-hidden-p node) (treeview-undisplay-node node t))))
(defun treeview-redisplay-node (node)
"Redisplay NODE.
- [nongnu] elpa/treeview 0d66ef2322 22/25: Made treeview-after-node-expanded-function and treeview-after-node-folded-function buffer-local, (continued)
- [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
- [nongnu] elpa/treeview e601230367 20/25: Removed needless intern statements, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 07ea52cd7f 16/25: Added package dependency on emacs 24.4, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 8382de4bdd 18/25: Sharp-quoted function name, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview f0c0711070 04/25: Insering/removing nodes; treeview-after-node-expanded-function and treeview-after-node-folded-function, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 5dff23aac0 09/25: New functions for navigation; misc. improvements, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 3038ebf96e 08/25: Fixed bug when removing first child, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 34ecd7a320 24/25: Fixed issues detected by flycheck; updated documentation, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview a82bc8c5d1 17/25: Removed needless progn around body of while, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 4a341b05bc 14/25: Bugfix for updating hidden nodes,
ELPA Syncer <=
- [nongnu] elpa/treeview 7fc5f30552 03/25: Initial commit of treeview.el, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 270cfbd5bd 06/25: Using 'let' to set buffer-read-only temporarily to t, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 0bdd3187c7 07/25: Reworked treeview-put so it can insert images, ELPA Syncer, 2022/09/10