From 96d53dddf35d28e0adfb2396975b1bb0e8b6d63a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Fr=C3=B3es=20Franco?= Date: Fri, 5 Jun 2026 02:05:56 +0000 Subject: [PATCH] fix(install): guard download_bin.vim against 'compatible' mode (dein build) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dein/vim-plug build hook runs `vim -e -s -c "source scripts/download_bin.vim"`, which starts in 'compatible' mode. There, leading-backslash line continuations aren't recognised, so the multi-line URL string raised `E10: \ should be followed by /, ? or &`. The install actually succeeded (binary downloaded), but in silent Ex mode any emitted error makes Vim exit non-zero — so dein reported a build failure. :NuwikiInstall worked because a normal session is 'nocompatible'. Wrap the script in the standard `let s:cpo_save = &cpo | set cpo&vim` … `let &cpo = s:cpo_save` guard so line continuations parse regardless of how it's invoked. Verified the exact dein command now exits 0. Co-Authored-By: Claude Opus 4.8 --- scripts/download_bin.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/download_bin.vim b/scripts/download_bin.vim index d3b32c1..0f6346f 100644 --- a/scripts/download_bin.vim +++ b/scripts/download_bin.vim @@ -3,6 +3,14 @@ " " Invoked by Dein / vim-plug build hooks: " vim -e -s -c "source scripts/download_bin.vim" -c "q" +" +" That invocation runs in 'compatible' mode, where leading-backslash line +" continuations aren't recognised (they'd raise E10, and any error in silent +" Ex mode makes Vim exit non-zero — a spurious build failure). Reset +" 'cpoptions' to the Vim default for the duration so the script parses, and +" restore it at the end. +let s:cpo_save = &cpo +set cpo&vim let s:plugin_dir = fnamemodify(resolve(expand(':p')), ':h:h') let s:bin_dir = s:plugin_dir . '/bin' @@ -89,3 +97,5 @@ else echohl ErrorMsg | echom 'nuwiki: install failed' | echohl None endif endif + +let &cpo = s:cpo_save