aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui/text.rs
diff options
context:
space:
mode:
authordiegodox2021-11-04 03:24:52 +0000
committerGitHub2021-11-04 03:24:52 +0000
commit70d21a903fef3ec0787c453f369d95e5223a2656 (patch)
tree27b1461ef8bc7e530c9d19c7293a9d3241685555 /helix-term/src/ui/text.rs
parent5b5d1b9dfff6b522559174f7f8e99aeb82c674a9 (diff)
Prevent preview binary or large file (#939)
* 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>
Diffstat (limited to 'helix-term/src/ui/text.rs')
0 files changed, 0 insertions, 0 deletions