fix: check fs_rename return value in selection store#103
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves robustness of the selection persistence logic by detecting and surfacing failures during the atomic temp-file rename step, and adds a regression test to ensure failures are logged.
Changes:
- Check and handle
vim.uv.fs_rename()return value when writing the selection store. - Add a functional regression test asserting a warning is logged when saving fails (intended to cover rename failures).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lua/diffview/selection_store.lua | Adds error handling for failed fs_rename() during atomic store writes. |
| lua/diffview/tests/functional/selection_store_spec.lua | Adds a regression test that expects a warning when a save operation fails (intended to cover rename failure). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5751e0a to
5a70fee
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
`vim.uv.fs_rename` returns nil+error on failure rather than throwing, so the surrounding pcall was not catching rename failures. Explicitly check the return value and raise on failure.
5a70fee to
a652265
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.