shikijs / shiki-magic-move

Smoothly animated code blocks with Shiki
https://shiki-magic-move.netlify.app/
MIT License
1.24k stars 40 forks source link

Unexpected transition when commenting a line #23

Open simjnd opened 2 months ago

simjnd commented 2 months ago

How to reproduce

  1. Go to the Shiki Magic Move Demo (https://shiki-magic-move.netlify.app/)
  2. Comment the import { defineComponent } from 'vue' line
  3. Notice a lot of things unexpectingly shuffling around (like the > of a closing paragraph tag several lines down For a more dramatic example you can check the Zig example on the same page and comment line 12 defer list.deinit();, a lot more symbol names jump around

Expected Behaviour In the case of commenting / decommenting a line I feel like the transition should be really simple, the line should just shift with the addition of the comment symbol and the color should fade

antfu commented 2 months ago

Yeah the algorithm can be improved. I am counting on someone to help with a PR - so PR welcome :)