canola.nvim/lua
Barrett Ruth f42c9dabd9
fix(preview): prevent preview from re-initializing modified oil buffers
Problem: when the preview window opens a directory that already has a
loaded oil buffer with unsaved edits, open_preview() unconditionally
calls load_oil_buffer() on it. This re-initializes the buffer via
view.initialize() -> render_buffer_async(), which re-fetches the
directory listing from disk and replaces all buffer lines, destroying
the user's pending edits. The mutation parser then can't see the
deleted entry in the source buffer, so it produces a COPY action
instead of a MOVE.

Solution: guard the load_oil_buffer() call in open_preview() with a
check for vim.b[filebufnr].oil_ready. Buffers that are already
initialized and rendered are not re-loaded, preserving any unsaved
modifications the user has made.

Closes: stevearc/oil.nvim#632
2026-02-21 02:42:51 -05:00
..
oil fix(preview): prevent preview from re-initializing modified oil buffers 2026-02-21 02:42:51 -05:00
resession/extensions cleanup: don't need empty methods in resession extension 2023-09-17 10:10:42 -07:00