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

@ -116,12 +116,11 @@ Regular files use netrw's native preview. Directories show a read-only summary o
their immediate children, including type, file size, modification time, and a
total for immediate files. Directories appear first, output is capped at 200
entries, and symbolic links are displayed without following them recursively.
File previews suppress syntax highlighting, Tree-sitter, diagnostics, and indent
guides so rapidly replaced content remains plain and quiet. Normal highlighting
and the buffer's prior diagnostic/indent-guide state return automatically when a
previewed file is opened for editing.
Preview-only file buffers remain loaded but unlisted until Neovim exits, avoiding
the parser detachment that triggers this Neovim 0.12 race.
File previews retain Tree-sitter or Vim syntax highlighting while suppressing
diagnostics and indent guides. The buffer's prior diagnostic and indent-guide
state returns automatically when a previewed file is opened for editing.
Preview-only file buffers remain loaded but unlisted until Neovim exits, retaining
the lifecycle protection added for rapid preview replacement.
Opening a file with `<CR>`, `o`, `v`, or `t`, or otherwise leaving netrw, closes
the preview. Closing it manually or pressing `p` again disables live updates