silverbulletmd / silverbullet

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

Clean replacement #774

Closed onespaceman closed 3 months ago

onespaceman commented 4 months ago

Most of clean.ts can be replaced with good ol' css.

web/active_lines.ts applies a style to active and selected lines, replacing all the isCursorInRange checks, and iterating over the syntax tree and css does the rest. A change in behavior is that marks now are visible whenever its line is active, instead of within the element. I don't think I can easily change this behavior to the old way, so if it's unacceptable, feel free to reject the pr. I just need to know if it's worth continuing to work on this.

End goal:

Checklist

zefhemel commented 4 months ago

This is very interesting. Let me play with this a little bit and see how it feels in practice.

zefhemel commented 4 months ago

Let's have a discussion here: https://community.silverbullet.md/t/request-for-feedback-testing/288

Honestly after playing with this a few minutes I'm not sure I like the expansion of the entire paragraph. Generally I don't like that text jumps when moving text around, although this is inherent in how live preview works. This jumping happens more often when all it requires is putting a cursor anywhere in the line, so... hmm.