guopenghui / obsidian-quiet-outline

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

Clicking a section always selects the section *above* that section #99

Closed ajh3 closed 3 months ago

ajh3 commented 1 year ago

See video:

https://user-images.githubusercontent.com/40405382/220735727-510d113d-4b49-411b-b38f-f4d79941d83b.mp4

SYSTEM INFO: Obsidian version: v1.1.15 Installer version: v1.1.15 Operating system: Windows 10 Pro 10.0.19045 Login status: logged in Catalyst license: none Insider build toggle: off Live preview: off Legacy editor: off Base theme: light Community theme: AnuPpuccin v1.3.1 Snippets enabled: 1 Restricted mode: off Plugins installed: 7 Plugins enabled: 5 1: Settings Search v1.3.6 2: Quiet Outline v0.3.15 3: Influx v2.1.2 4: Style Settings v1.0.3 5: Kanban v1.5.2

bonfiresh commented 1 year ago

on mobile device,the same issue

guopenghui commented 1 year ago

I think it's because this plugin can't find precise current location. It uses the 8th line in view as the divider. When you click "AM questions",this heading appears on the middle of view, but it's under the 8th line so "SA terminology" is treated as the current location.

Obsidian API doesn't offer an API to get lines count in view, so 8th-line is a rough workaround.

ajh3 commented 1 year ago

Possibly related? https://forum.obsidian.md/t/toc-navigation-when-selecting-a-header-the-header-above-gets-highlighted/13662

thejamesm commented 11 months ago

I'm guessing Obsidian is hard-coded to scroll the heading to the centre of the pane. Personally I think it would be better to place it nearer the top (similar to the 8th line measure), since readers are far more likely to be interested in what's below the heading they clicked on than what's above. If it is possible to override the default scroll-to behaviour, I would suggest doing so to match the heading highlighting.

nickchomey commented 9 months ago

I agree with @thejamesm

guopenghui commented 3 months ago

Latest version should fix this issue, so close it.