branch: externals/ztree commit 67a1d90595353ab57fd424651c567df9851b9494 Author: Alexey Veretennikov <txm.four...@gmail.com> Commit: Alexey Veretennikov <txm.four...@gmail.com>
Issue #56: Dont preserve a cursor position on widen/narrow operations Since the buffer is recreated entirely there is no sense to preserve a cursor position. --- ztree-view.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ztree-view.el b/ztree-view.el index 7e0a89a..65eec89 100644 --- a/ztree-view.el +++ b/ztree-view.el @@ -677,7 +677,10 @@ Optional argument LINE scroll to the line given." This will reuse all other settings for the current ztree buffer, but change the root node to the node specified." (setq ztree-start-node node - ztree-expanded-nodes-list (list ztree-start-node)) + ztree-expanded-nodes-list (list ztree-start-node) + ;; then the new root node is given, no sense to preserve + ;; a cursor position + ztree-prev-position nil) (ztree-refresh-buffer))