feat: use scratch buffer for file previews (#467)

* Initial implementation of scratch based preview

* Fix call to buf is valid in loop

* Fixing call to be made only from the main event loop

* Improve handling of large files from @pkazmier

* Better error handling and simplifying the code

* Default to old behavior

* Add documentation

* Fix readfile

* Fix the configuration

* refactor: single config enum and load real buffer on BufEnter

* doc: regenerate documentation

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
This commit is contained in:
Jalal El Mansouri 2024-11-20 02:24:24 +01:00 committed by GitHub
parent 8ea40b5506
commit 21705a1deb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 79 additions and 21 deletions

View file

@ -157,8 +157,8 @@ CONFIG *oil-confi
preview_win = {
-- Whether the preview window is automatically updated when the cursor is moved
update_on_cursor_moved = true,
-- Maximum file size in megabytes to preview
max_file_size_mb = 100,
-- How to open the preview window "load"|"scratch"|"fast_scratch"
preview_method = "fast_scratch",
-- Window-local options to use for preview window buffers
win_options = {},
},