Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wraparound Issue with Notes in Sidebar #7

Closed
phibr0 opened this issue Dec 19, 2020 · 1 comment
Closed

Wraparound Issue with Notes in Sidebar #7

phibr0 opened this issue Dec 19, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@phibr0
Copy link
Collaborator

phibr0 commented Dec 19, 2020

However, in my case, that's probably due to an Obsidian issue that prevents making a sidebar document active. (Obsidian allows dragging a document into a sidebar pane, but it doesn't allow making it "active", even though you can click into it and edit it.) Sidebar documents are included in iterateLeaves() and getLeavesOfType("markdown"), so this plugin attempts to cycle through them. But since they cannot be made active, the previously-active leaf remains active, so the cycling stops.

One way to fix that would be for this plugin to skip such leaves when moving forward or backward. A simple way to do this is to check that the workspace.activeLeaf has actually changed after calling setActiveLeaf(). If it hasn't, then the leaf wasn't suitable, and needs to be skipped in the rotation. This approach should be forward compatible in case Obsidian ever actually allows sidebar leaves to become active.

~ @pjeby

@phibr0 phibr0 assigned phibr0 and Vinzent03 and unassigned phibr0 Dec 19, 2020
@phibr0 phibr0 added the bug Something isn't working label Dec 19, 2020
@pjeby
Copy link

pjeby commented Dec 19, 2020

Thanks! This works correctly with the current Obsidian.

Vinzent03 added a commit that referenced this issue Dec 12, 2021
See #9 for discussion. First reported in #7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants