diff --git a/neovim/lua/plugins.lua b/neovim/lua/plugins.lua index 12c59b7..998db3e 100644 --- a/neovim/lua/plugins.lua +++ b/neovim/lua/plugins.lua @@ -1,7 +1,7 @@ -- Install packer local utils = require("utils") local install_path = vim.fn.stdpath("data") .. "/site/pack/packer/opt/packer.nvim" -local packer_bootstrap = false +local packer_bootstrap = "" if vim.fn.empty(vim.fn.glob(install_path)) > 0 then packer_bootstrap = vim.fn.system({ "git", "clone", "https://github.com/wbthomason/packer.nvim", install_path }) end @@ -411,6 +411,6 @@ use({ }) -- Auto sync after bootstrapping on a fresh box -if packer_bootstrap then +if packer_bootstrap ~= "" then packer.sync() end diff --git a/neovim/lua/utils.lua b/neovim/lua/utils.lua index 8cd1bd0..21de75b 100644 --- a/neovim/lua/utils.lua +++ b/neovim/lua/utils.lua @@ -159,7 +159,7 @@ M.nil_val = {} -- If more than one rule matches, the one with the greatest version number is used function M.map_version_rule(rules) local v = vim.version() - local current_version = { v.major, v.minor, v.patch } + local current_version = { v and v.major, v and v.minor, v and v.patch } -- Parse a constraint and version of a string local parse_rule = function(rule_string)