Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ch CSS unit to simplify awesome_line_wrapping CM plugin #2899

Merged
merged 6 commits into from
Apr 19, 2024

Conversation

fonsp
Copy link
Owner

@fonsp fonsp commented Apr 19, 2024

The awesome_line_wrapping that wraps lines in a tab-aware currently works by counting tabs at the start of the line, calculates their width in pixels, and offsets the subsequent text by a negative amount.

image

It's quite complicated because the space width needs to be measured. This can be simplified by using the ch CSS unit, and taking 1ch as the space width.

I also removed some stale code

@fonsp fonsp added frontend Concerning the HTML editor CM6 CodeMirror 6 labels Apr 19, 2024
Copy link
Contributor

Try this Pull Request!

Open Julia and type:

julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="https://github.com/fonsp/Pluto.jl", rev="line-wrapper-plugin-ch")
julia> using Pluto

@fonsp fonsp merged commit 6746395 into main Apr 19, 2024
3 checks passed
@fonsp fonsp deleted the line-wrapper-plugin-ch branch April 19, 2024 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CM6 CodeMirror 6 frontend Concerning the HTML editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant