Clicking heading from outline jumps to wrong heading in Preview pane (off by one error?)

Steps to reproduce

  1. open Help vault.
  2. new note
  3. paste in the code from this gist as an example
  4. set up 2 pane view, edit on left, preview on right
  5. enable core plugin: Outline
  6. from Outline, click among the headings.

Expected result

preview pane tracks edit pane as far as jumping to the clicked heading

Actual result

Clicking on Heading 1 makes the preview jump to Heading 5. Then, clicking Heading 5 makes the preview pane jump to Heading 1. Seems like an off by one error. More obvious when watching the video below.

Environment

  • Operating system: macOS 12.2.1
  • Debug info:
	Obsidian version: v0.13.30
	Installer version: v0.13.30
	Operating system: Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T8101 21.3.0
	Login status: logged in
	Catalyst license: insider
	Insider build toggle: on
	Live preview: off
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 13
	Safe mode: off

Video

this is scrolling problems among linked panes. Sometimes you need two clicks to align panes.

@WhiteNoise that’s not quite what the video shows… it’s toggling back and forth between the headings exactly opposite of the one I clicked on. So, is this an upstream bug then?

0.13.31 (E17) no change

let me know if this is better when we release 0.14.