Cross-line selection doesn't work well with margin

Hi @marijn,

I have been working on list styles for my Markdown app MarkEdit. The goal is to make list items aligned to the bullets.

It went pretty well with results like this:

I used text-indent and margin-inline-start to indent the content. However, I noticed the selection layers are not fully rendered if I select multiple lines:

(To be clear, margin-left doesn’t work either)

Do you have any suggestions? Thank you!

Moving content around is indeed likely to cause issues. Does the approach in this thread work better for you?

1 Like

Interesting! I just replace Decoration.mark with Decoration.line in my approach, and it seems fixed.

I will test more to see if there’s any other issues, thanks a lot!

It looks promising, except for the active line drawing would not be full width since the whole line is indented:

Currently, I am leveraging a Layer extension to fill the gap:

I will share it out if it works.

Just sharing my approach here: Implement list indentation style by cyanzhong · Pull Request #256 · MarkEdit-app/MarkEdit · GitHub.

Improved a little bit: