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

feat: enable virtual scrolling in code preview #133

Merged
merged 4 commits into from
Jan 22, 2025

Conversation

Joery-M
Copy link
Contributor

@Joery-M Joery-M commented Jan 21, 2025

Description

This PR changes the code preview to use the built-in virtual scrolling of CodeMirror. This is usefull when viewing large files like pre-bundled dependencies.

This PR also solved a minor issue where the diff toggle would not trigger the watchEffect. If it's preferred, I'll make a seperate PR.

Linked Issues

Additional context

This PR enables the searching module in CodeMirror. Usually the browser would be able to search through the code, but when virtual scrolling is enabled, this is not available.
The scrolling is linked on a percentage basis, preview below:

vite-plugin-inspect-scroll.mp4

@antfu antfu changed the title perf: enable virtual scrolling in code preview feat: enable virtual scrolling in code preview Jan 22, 2025
@antfu
Copy link
Member

antfu commented Jan 22, 2025

Thank you!

@antfu antfu merged commit 8721632 into antfu-collective:main Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants