Unverified Commit 8fd65e57 authored by Heitor Augusto's avatar Heitor Augusto
Browse files

vimPlugins.blink-cmp: fix runtime version detection error

The plugin fails to load in neovim because it cannot detect the git tag
used during build time. Add patch to force using src.tag instead of
runtime detection, preventing the error:
"Detected an out of date or missing fuzzy matching library. Can't
download from github due to not being on a git tag..."
parent d9e47289
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
  vimUtils,
  nix-update-script,
  git,
  replaceVars,
}:
let
  version = "0.8.2";
@@ -39,6 +40,10 @@ vimUtils.buildVimPlugin {
    ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy.${libExt} target/release/libblink_cmp_fuzzy.${libExt}
  '';

  patches = [
    (replaceVars ./force-version.patch { inherit (src) tag; })
  ];

  passthru = {
    updateScript = nix-update-script {
      attrPath = "vimPlugins.blink-cmp.blink-fuzzy-lib";
+11 −0
Original line number Diff line number Diff line
--- a/lua/blink/cmp/fuzzy/download/init.lua
+++ b/lua/blink/cmp/fuzzy/download/init.lua
@@ -21,7 +21,7 @@ function download.ensure_downloaded(callback)
       }
     end)
     :map(function(version)
-      local target_git_tag = download_config.force_version or version.git.tag
+      local target_git_tag = download_config.force_version or '@tag@'

       -- not built locally, not on a git tag, error
       assert(