fonsp / Pluto.jl

🎈 Simple reactive notebooks for Julia
https://plutojl.org/
MIT License
4.91k stars 284 forks source link

⚡️ Autocomplete latex and emoji super fast #2876

Closed fonsp closed 3 months ago

fonsp commented 3 months ago

This PR loads all latex and emoji symbols once, and then completes them locally with JavaScript: https://codemirror.net/docs/ref/#autocomplete.completeFromList

This makes the symbol completions instant, because there is no network overhead.

The initial download of symbols is only 60 kB, it's triggered the first time autocomplete is used.

Before

With "Slow 3G" network throttling:

https://github.com/fonsp/Pluto.jl/assets/6933510/892afdc1-d501-4330-a582-566539f69467

With "Fast 3G" network throttling:

https://github.com/fonsp/Pluto.jl/assets/6933510/621ba875-3a35-4419-9e1e-56cdfd247df3

After

https://github.com/fonsp/Pluto.jl/assets/6933510/4c32b60e-4fb8-42df-b53c-5758c2d9689a

github-actions[bot] commented 3 months ago

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="autocomplete-latex-emoji-preloaded")
  julia> using Pluto