helix-mods/helix-term/src
diegodox 70d21a903f
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>
2021-11-04 12:24:52 +09:00
..
ui Prevent preview binary or large file (#939) 2021-11-04 12:24:52 +09:00
application.rs Bump lsp-types to 0.91.0 (#932) 2021-10-29 12:00:18 +09:00
args.rs Implement hx --tutor and :tutor to load tutor.txt (#898) 2021-10-28 10:23:46 +09:00
commands.rs only remove primary index when search next without extend (#948) 2021-11-02 13:32:57 +09:00
compositor.rs Fix doctest broken on 2021 edition 2021-10-22 12:47:02 +09:00
config.rs config: Rename [terminal] to [editor] and pass it into Editor 2021-08-08 14:10:01 +09:00
job.rs Drop some &mut bounds where & would have sufficed 2021-09-06 15:25:46 +09:00
keymap.rs Hide keys bound to no_op from infobox (#971) 2021-11-04 09:50:38 +09:00
lib.rs Remove #[allow(unused)] from helix-term, and fix unused imports. 2021-07-01 19:06:52 -07:00
main.rs Add --tutor option to hx --help output (#924) 2021-10-28 16:27:28 +09:00