From c13230628d1563b2a0ac481937cf4690f2e9450d Mon Sep 17 00:00:00 2001 From: aarondill Date: Wed, 12 Jul 2023 07:25:07 -0500 Subject: [PATCH] move *up* arch check to ensure that unsupported arches get aborted early. This avoids notifying when the machine is unsupported. This is prefered behavior by *at least* @vendion --- lua/tabnine/binary.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lua/tabnine/binary.lua b/lua/tabnine/binary.lua index 8b35d4b..86f8459 100644 --- a/lua/tabnine/binary.lua +++ b/lua/tabnine/binary.lua @@ -38,6 +38,11 @@ local function binary_name() end local function binary_path() + local machine = arch_and_platform() + if not machine then + return nil -- Is this machine supported? + end + local paths = vim.tbl_map(function(path) return fn.fnamemodify(path, ":t") end, fn.glob(binaries_path .. "/*", true, true)) @@ -53,10 +58,6 @@ local function binary_path() vim.notify("Did you remember to run the build script for tabnine-nvim?", vim.log.levels.WARN) return nil -- Is it installed? end - local machine = arch_and_platform() - if not machine then - return nil -- Is this machine supported? - end local binary = binaries_path .. "/" .. tostring(version) .. "/" .. machine .. "/" .. binary_name() if vim.fn.filereadable(binary) then -- Double check that it's installed