-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: (org-sidebar-tree-toggle) Toggle tree sidebar off properly
I think I broke this in the previous fix by omitting pre-first-heading content from the sidebar when it displays the whole buffer, which caused the comparison of the buffers' point-min to fail. Fixes #34. Thanks to Matt Price (@titaniumbones) and @MKB6 for reporting. Released as 0.3.2.
- Loading branch information
Showing
2 changed files
with
9 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
;; Author: Adam Porter <[email protected]> | ||
;; URL: https://github.com/alphapapa/org-sidebar | ||
;; Version: 0.3.1 | ||
;; Version: 0.3.2 | ||
;; Package-Requires: ((emacs "26.1") (s "1.10.0") (dash "2.13") (dash-functional "1.2.0") (org "9.0") (org-ql "0.2") (org-super-agenda "1.0")) | ||
;; Keywords: hypermedia, outlines, Org, agenda | ||
|
||
|
@@ -509,13 +509,15 @@ If it is open and shows the view for the current buffer, delete | |
it. Otherwise, show it for current buffer." | ||
(interactive) | ||
(let* ((parent-point-min (point-min)) | ||
(parent-point-max (point-max)) | ||
(parent-buffer (or (buffer-base-buffer) | ||
(current-buffer))) | ||
(tree-window (--first (window-parameter it 'org-sidebar-tree-window) | ||
(window-at-side-list nil org-sidebar-tree-side)))) | ||
(if (and tree-window | ||
(with-current-buffer (window-buffer tree-window) | ||
(and (eq parent-point-min (point-min)) | ||
(and (<= parent-point-min (point-min)) | ||
(= parent-point-max (point-max)) | ||
(or (eq parent-buffer (buffer-base-buffer)) | ||
(eq parent-buffer (current-buffer)))))) | ||
;; Tree displays current buffer: delete tree window. | ||
|