silverbulletmd / silverbullet

The hackable notebook
https://silverbullet.md
MIT License
2.06k stars 146 forks source link

Code widget buttons use old widget position #734

Closed Maarrk closed 4 months ago

Maarrk commented 4 months ago

The button gets the position here, and doesn't update it until you enter it with the cursor.

https://github.com/silverbulletmd/silverbullet/blob/cf010b5ef29a1dfde166241ae6e6c6dac21d89bf/web/cm_plugins/markdown_widget.ts#L243-L250

zefhemel commented 4 months ago

@Maarrk Fixed this now, and the fix will affect your #719 PR since the argument passed to invokeFunction has changed to pass in the bodyText instead of the (sometimes) inaccurate from. Not 100% happy with this fix, but should be ok.