silence netrw preview scroll boundaries
This commit is contained in:
parent
c48c9451fc
commit
4a721f051e
3 changed files with 3 additions and 1 deletions
1
LOG.md
1
LOG.md
|
|
@ -219,6 +219,7 @@ Record every decision here with a short rationale. Append new entries; do not re
|
|||
- 2026-10-28: Disabled diagnostic rendering in netrw file preview buffers. The preview metadata records each buffer's prior diagnostic state and restores it when the file is opened for editing, keeping ephemeral previews quiet without overriding buffers where diagnostics were already disabled.
|
||||
- 2026-10-28: Made netrw file previews intentionally plain after CSS and HTML exposed residual colour. The remaining decoration was Vim regex syntax plus indent-blankline extmarks, not diagnostics or Tree-sitter. Preview buffers now clear `syntax` and disable their buffer-local indent guides, then restore both recorded states on real edit.
|
||||
- 2026-10-28: Added buffer-local netrw `<M-j>` / `<M-k>` mappings to scroll the current preview with native `<C-e>` / `<C-y>` behavior while focus remains in the tree. The mappings accept Vim counts and quietly do nothing when no preview exists.
|
||||
- 2026-10-28: Hardened preview scrolling after an interactive over-scroll surfaced a window-local error that did not reproduce headlessly. The temporary preview-window call is now protected, so stale-window and boundary failures are treated like native top/bottom clamping instead of reaching the command line.
|
||||
|
||||
## Project-Local Configuration
|
||||
|
||||
|
|
|
|||
|
|
@ -670,6 +670,7 @@ file 3.2K 2026-10-27 12:55 telescope.lua
|
|||
- [x] Hide diagnostics in file previews and restore their prior per-buffer state on edit
|
||||
- [x] Suppress remaining Vim syntax and indent-guide decoration in file previews, restoring prior state on edit
|
||||
- [x] Add count-aware `<M-j>` / `<M-k>` preview scrolling without moving focus from netrw
|
||||
- [x] Make preview scrolling silently clamp at file/window boundaries
|
||||
- [ ] Test the workflow in an actual SSH session
|
||||
- [ ] Confirm stock netrw remains understandable when this configuration is unavailable
|
||||
|
||||
|
|
|
|||
|
|
@ -633,7 +633,7 @@ local function scroll_preview(direction, count)
|
|||
end
|
||||
|
||||
local key = vim.keycode(direction > 0 and '<C-e>' or '<C-y>')
|
||||
vim.api.nvim_win_call(preview, function()
|
||||
pcall(vim.api.nvim_win_call, preview, function()
|
||||
vim.cmd.normal({ args = { tostring(count) .. key }, bang = true })
|
||||
end)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue