Restore highlighting in netrw previews

Keep the loaded-buffer lifecycle protection while allowing Tree-sitter or Vim syntax highlighting; diagnostics and indent guides remain suppressed.
This commit is contained in:
Ray Elliott 2026-10-28 19:46:00 +00:00
commit 306b1c188c
3 changed files with 6 additions and 8 deletions

View file

@ -502,9 +502,7 @@ local function show_native_preview(state, entry)
vim.bo[preview_buf].bufhidden = 'hide'
vim.bo[preview_buf].buflisted = preview_buffers[preview_buf].buflisted
vim.b[preview_buf].netrw_live_preview_buffer = true
pcall(vim.treesitter.stop, preview_buf)
vim.diagnostic.enable(false, { bufnr = preview_buf })
vim.bo[preview_buf].syntax = ''
set_indent_guides(preview_buf, false)
end
end