From 55f87293b7ffd522dd5f247a54878384b2c2a7a4 Mon Sep 17 00:00:00 2001 From: Ryan Cumming Date: Mon, 26 Feb 2024 16:37:08 +1100 Subject: [PATCH] fix: Restore Neovim 0.9.5 compatibility It looks like some dependencies on Lua features only available on Neovim `master` have snuck in: - Having `vim.uv` as an alias for `vim.loop` - `vim.fs.joinpath` --- lua/pckr/fsstate.lua | 2 +- lua/pckr/plugin_types/local.lua | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lua/pckr/fsstate.lua b/lua/pckr/fsstate.lua index c20d57d..9195dc3 100644 --- a/lua/pckr/fsstate.lua +++ b/lua/pckr/fsstate.lua @@ -38,7 +38,7 @@ local function get_dir_plugins(dir) for name, ty in vim.fs.dir(dir) do if ty ~= 'file' then local path = util.join_paths(dir, name) - if vim.uv.fs_stat(path) then + if uv.fs_stat(path) then plugins[path] = name end end diff --git a/lua/pckr/plugin_types/local.lua b/lua/pckr/plugin_types/local.lua index d1e6837..9630e19 100644 --- a/lua/pckr/plugin_types/local.lua +++ b/lua/pckr/plugin_types/local.lua @@ -1,5 +1,8 @@ local a = require('pckr.async') local log = require('pckr.log') +local util = require('pckr.util') + +local uv = vim.loop --- @class Pckr.PluginHandler.Local: Pckr.PluginHandler local M = {} @@ -14,8 +17,8 @@ end --- @param disp Pckr.Display --- @return string? M.updater = a.sync(function(plugin, disp) - local gitdir = vim.fs.joinpath(plugin.install_path, '.git') - if vim.uv.fs_stat(gitdir) then + local gitdir = util.join_paths(plugin.install_path, '.git') + if uv.fs_stat(gitdir) then return require('pckr.plugin_types.git').updater(plugin, disp, true) end -- Nothing to do