feat: config option to disable previewing a file
This commit is contained in:
parent
5acab3d8a9
commit
3fa3161aa9
4 changed files with 19 additions and 0 deletions
|
|
@ -541,6 +541,11 @@ M.open_preview = function(opts, callback)
|
|||
then
|
||||
filebufnr =
|
||||
util.read_file_to_scratch_buffer(normalized_url, config.preview_win.preview_method)
|
||||
elseif entry_is_file and config.preview_win.disable_preview(normalized_url) then
|
||||
filebufnr = vim.api.nvim_create_buf(false, true)
|
||||
vim.bo[filebufnr].bufhidden = "wipe"
|
||||
vim.bo[filebufnr].buftype = "nofile"
|
||||
util.render_text(filebufnr, "Preview disabled", { winid = preview_win })
|
||||
end
|
||||
|
||||
if not filebufnr then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue