canola.nvim/doc
Barrett Ruth 4b32ada2d9
feat(preview): add max_file_size config to skip large file previews
Problem: previewing large files (e.g. 500 MB logs, binaries) loads them
into a buffer and can freeze or OOM Neovim. `disable_preview` only
receives the filename, so users cannot gate on file size.

Solution: add `preview_win.max_file_size` (number, MB, default 10). In
`open_preview`, check `entry.meta.stat.size` and fall back to
`vim.uv.fs_stat` when the cached stat is absent. If the file exceeds
the limit and a preview window is already open, render "File too large
to preview" in it; if not, emit a WARN notify and return early. The
cursor-moved auto-update path only fires when a window already exists,
so no flag threading is needed to distinguish explicit from implicit.

Based on: stevearc/oil.nvim#213
2026-03-07 16:49:08 -05:00
..
canola.txt feat(preview): add max_file_size config to skip large file previews 2026-03-07 16:49:08 -05:00
upstream.md feat(preview): add max_file_size config to skip large file previews 2026-03-07 16:49:08 -05:00