Sync Neovim's plugins once more if Neovim crashes

Neovim 0.12.6 segfaulted on the way out after a finished Lazy! sync
(report CD-P8RUBS), and the update step failed though the plugins were
up to date. If nvim dies from a signal, run the sync once more; it
fails if Neovim crashes again, and an ordinary failure isn't retried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 06:10:38 -07:00
co-authored by Claude Opus 5.5
parent d1108698bb
commit 902967f111
2 changed files with 40 additions and 1 deletions
+11 -1
View File
@@ -33,5 +33,15 @@ set_aside_broken_plugins() {
run_update() {
echo "Updating Neovim plugins..."
set_aside_broken_plugins
nvim --headless "+Lazy! sync" +qa
# Neovim has crashed on the way out after a finished sync (a segfault on
# 0.12.6, report CD-P8RUBS, 2026-11-11). If it dies from a signal, sync once
# more: that finishes anything left over, and fails if it crashes again.
local status=0
nvim --headless "+Lazy! sync" +qa || status=$?
if [ "$status" -gt 128 ]; then
echo " Neovim crashed (signal $((status - 128))), so syncing the plugins once more..."
nvim --headless "+Lazy! sync" +qa
return
fi
return "$status"
}