diff --git a/LOG.md b/LOG.md index 6ff9515..89fa67c 100644 --- a/LOG.md +++ b/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 `` / `` mappings to scroll the current preview with native `` / `` 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 diff --git a/MIGRATION_PLAN.md b/MIGRATION_PLAN.md index 9e13b18..7abfa92 100644 --- a/MIGRATION_PLAN.md +++ b/MIGRATION_PLAN.md @@ -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 `` / `` 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 diff --git a/lua/netrw-preview.lua b/lua/netrw-preview.lua index 1dfae69..90aaded 100644 --- a/lua/netrw-preview.lua +++ b/lua/netrw-preview.lua @@ -633,7 +633,7 @@ local function scroll_preview(direction, count) end local key = vim.keycode(direction > 0 and '' or '') - 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