Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a strange return in the bootstrapping example? #1239

Open
stephane-archer opened this issue Jun 5, 2023 · 1 comment
Open

a strange return in the bootstrapping example? #1239

stephane-archer opened this issue Jun 5, 2023 · 1 comment
Labels
bug v1 An issue or PR relevant to packer v2

Comments

@stephane-archer
Copy link

in the following snippet provided to bootstrap packer:

local ensure_packer = function()
  local fn = vim.fn
  local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
  if fn.empty(fn.glob(install_path)) > 0 then
    fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
    vim.cmd [[packadd packer.nvim]]
    return true
  end
  return false
end

local packer_bootstrap = ensure_packer()

return require('packer').startup(function(use)
  use 'wbthomason/packer.nvim'
  -- My plugins here
  -- use 'foo1/bar1.nvim'
  -- use 'foo2/bar2.nvim'

  -- Automatically set up your configuration after cloning packer.nvim
  -- Put this at the end after all plugins
  if packer_bootstrap then
    require('packer').sync()
  end
end)

the following line is I think strange:

return require('packer').startup(function(use)

removing the return fixes the issue I had

@stephane-archer stephane-archer added bug v1 An issue or PR relevant to packer v2 labels Jun 5, 2023
@acid-bong
Copy link

Return is supposed to be the final command in the function/module (I bet the error says "expected EOF after the line [where end) is]", doesn't it?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug v1 An issue or PR relevant to packer v2
Projects
None yet
Development

No branches or pull requests

2 participants