guopenghui / obsidian-quiet-outline

Improving experience of outline in Obsidian
MIT License
300 stars 17 forks source link

Expanding incorrect section on click #182

Open TheMathGuyd opened 3 months ago

TheMathGuyd commented 3 months ago

Upon clicking on a heading in the quiet outline, the heading above is expanded, rather than the one clicked. https://github.com/guopenghui/obsidian-quiet-outline/assets/85257386/771f791a-d5ec-40c3-977c-362871c66dd2

guopenghui commented 3 months ago

Ok, I have kind of fixed this. (waiting 200ms -> 500ms)

There are two different events controling heighlighing and expanding——cusor position change and scroll. But when you click a heading, both event occurs. So sometimes calculating to different position results. Current strategy is, when clicking a heading, scroll event will be blocked for 500ms, so only cursor position change takes effect. But 500ms may not be a perfect choice, clicking too fast can make it lose effectiveness.

TheMathGuyd commented 3 months ago

Thank you. Works well enough.

edit: nvm. after 5 minutes, the behavior reverted