-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
file picker freezes on big binary files #847
Comments
also I don't quite understand why file picker works the way it does - I would expect it to list only current working dir files, but it lists every imaginable file on my desktop. |
What displays when you |
ah, it displays me my home dir, but why it does so if I've opened helix with |
This is likely related to #338 Edit: Never mind, I misread. |
Hmm, are you using |
If you start helix with a directory as the argument, it will use that directory. Otherwise, it will use the directory your shell is currently in. |
I don't understand, I mentioned the directory, but helix remained in the current one (home) |
Oh, I see. I imagine it should work like that, but apparently it doesn't. I guess I can try and fix that and open a PR. |
We should skip rendering both binary files and files over a certain limit (10-20MB) |
* Prevent preview binary or large file (#847) * fix wrong method name * fix add use trait * update lock file * rename MAX_PREVIEW_SIZE from MAX_BYTE_PREVIEW * read small bytes to determine cotent type * [WIP] add preview struct to represent calcurated preveiw * Refactor content type detection - Remove unwraps - Reuse a single read buffer to avoid 1kb reallocations between previews * Refactor preview rendering so we don't construct docs when not necessary * Replace unwarap whit Preview::NotFound * Use index access to hide unwrap Co-authored-by: Blaž Hrastnik <blaz@mxxn.io> * fix Get and unwarp equivalent to referce of Index acess * better preview implementation * Rename Preview enum and vairant Co-authored-by: Gokul Soumya <gokulps15@gmail.com> * fixup! Rename Preview enum and vairant * simplify long match * Center text, add docs, fix formatting, refactor Co-authored-by: Blaž Hrastnik <blaz@mxxn.io> Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
Fixed by #939 |
so when I am in my Downloads folder and use my Up and Down arrows to navigate the menu I experience full freeze when something like Linux distribution 1.9Gb iso image is selected.
one thing it does not even need to preview these types of files, the second: preview is implemented in a wrong way so it (supposedly) tries to read the file entirely when only the first "page" is enough.
The text was updated successfully, but these errors were encountered: